From d7d9f687440449f6effd2339d5f1a18f86180ef5 Mon Sep 17 00:00:00 2001 From: wes Date: Thu, 6 Jul 2017 20:03:33 -0400 Subject: [PATCH] add class --- bfilter.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bfilter.py b/bfilter.py index 8ca0525..96e0445 100755 --- a/bfilter.py +++ b/bfilter.py @@ -59,3 +59,16 @@ class BloomFilter: def __getitem__(self, key): return lib.bfilter_get(self.bitset, key.encode("UTF-8"), self.k) == 1 + + +with open("./roadnottaken") as rnt: + words = rnt.read().split(" ") + for word in words: + test.add(word) + + for word in words: + print(test[word]) + + print(test["wes"]) + +# lib.print_barray(bfilter)