3 ms·
As a practical example of this, consider searching a corpus of texts for a phrase. You can build a bloom filter from each text ahead of time, using each individ
by lilyball 10y ago
As a practical example of this, consider searching a corpus of texts for a phrase. You can build a bloom filter from each text ahead of time, using each individual word as the elements to put in the filter. Then when searching, you can split the search phrase into words and check if all the words occur in the bloom filters. If any word does not occur, then you know the phrase won't match that text. But if the bloom filter can't rule out any of the words, then you can do the more expensive full-text search. This means you can search the whole corpus much quicker, as you can skip any text that doesn't match the words.
- sk5t 10y agoI might be inclined to use a lightly massaged prefix tree (adding an "end of word" symbol) instead of a bloom filter in this particular case, depending on the size of dictionary and cost of a false-maybe.