Skip to content

Commit e58e107

Browse files
committed
Update README.md to make all code examples work.
1 parent f88bd8d commit e58e107

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

ProbabilisticDataStructures.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1010
Default.testsettings = Default.testsettings
1111
LICENSE.txt = LICENSE.txt
1212
ProbabilisticDataStructures.vsmdi = ProbabilisticDataStructures.vsmdi
13+
README.md = README.md
1314
EndProjectSection
1415
EndProject
1516
Global

ProbabilisticDataStructures/Element.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace ProbabilisticDataStructures
88
{
9-
internal class Element
9+
public class Element
1010
{
1111
public byte[] Data { get; set; }
1212
public UInt64 Freq { get; set; }

ProbabilisticDataStructures/TopK.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public TopK Add(byte[] data)
5757
/// Returns the top-k elements from lowest to highest frequency.
5858
/// </summary>
5959
/// <returns>The top-k elements from lowest to highest frequency</returns>
60-
internal Element[] Elements()
60+
public Element[] Elements()
6161
{
6262
return elements.Elements();
6363
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,15 @@ namespace FilterExample
234234
byte[] A_BYTES = Encoding.ASCII.GetBytes("a");
235235
byte[] B_BYTES = Encoding.ASCII.GetBytes("b");
236236

237-
var cf = new CuckooFilter(1000, 0.01);
237+
var cf = new CuckooBloomFilter(1000, 0.01);
238238

239239
cf.Add(A_BYTES);
240240
if (cf.Test(A_BYTES))
241241
{
242242
Console.WriteLine("contains a");
243243
}
244244

245-
if (!cf.TestAndAdd(B_BYTES))
245+
if (!cf.TestAndAdd(B_BYTES).WasAlreadyAMember)
246246
{
247247
Console.WriteLine("doesn't contain b");
248248
}
@@ -372,7 +372,7 @@ namespace FilterExample
372372
topK.Add(SARA_BYTES).Add(SARA_BYTES);
373373
topK.Add(BILL_BYTES);
374374

375-
for (var element in topK.Elements())
375+
foreach (var element in topK.Elements())
376376
{
377377
Console.WriteLine(string.Format("element: {0}, frequency: {1}", Encoding.ASCII.GetString(element.Data), element.Freq));
378378
}

0 commit comments

Comments
 (0)