Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BloomFilter ¶
BloomFilter is struct is a simple implementation for https://en.wikipedia.org/wiki/Bloom_filter This implementation is inspired from https://pypi.org/project/pybloom/
func New ¶
func New(n int, e float64) (*BloomFilter, error)
New creates pointer of BloomFilter by given n as capacity, and e as error rate
func (*BloomFilter) Add ¶
func (bf *BloomFilter) Add(sentence string)
Add stores sentence to the bitset word by word
func (*BloomFilter) Check ¶
func (bf *BloomFilter) Check(sentence string) bool
Check checks if sentence exists in the bitset
Click to show internal directories.
Click to hide internal directories.