def load_bitmap(file) : words = open(file).readlines() words = map(lambda x: x.strip(), words) bmap = Bitmap(2**20) for word in words : hashes = make_hashes(word) for hash in hashes : bmap.setBit(hash) return bmap
def loadBitmap(file): # generate bitmap from lexicon file (one word per line) words = open(file).readlines() words = map(lambda x: x.strip(), words) # no newlines please bmap = Bitmap(2**20) for word in words: hashes = makeHashes(word) for hash in hashes: bmap.setBit(hash) return bmap
def loadBitmap(file) : # generate bitmap from lexicon file (one word per line) words = open(file).readlines() words = map(lambda x: x.strip(), words) # no newlines please bmap = Bitmap(2**20) for word in words : hashes = makeHashes(word) for hash in hashes : bmap.setBit(hash) return bmap