]> gitweb.factorcode.org Git - factor.git/blob - basis/bloom-filters/bloom-filters-docs.factor
inverse: Fix docs
[factor.git] / basis / bloom-filters / bloom-filters-docs.factor
1 USING: help.markup help.syntax kernel math ;
2 IN: bloom-filters
3
4 HELP: <bloom-filter>
5 { $values { "error-rate" "The desired false positive rate. A " { $link float } " between 0 and 1." }
6           { "capacity" "The expected number of object in the set. A positive " { $link integer } "." }
7           { "bloom-filter" bloom-filter } }
8 { $description "Creates an empty Bloom filter." }
9 { $errors "Throws a " { $link invalid-size } " when unable to produce a filter meeting the given constraints. Throws a " { $link invalid-error-rate } " or a " { $link invalid-capacity } " when input is invalid." } ;
10
11
12 HELP: bloom-filter-insert
13 { $values { "object" object }
14           { "bloom-filter" bloom-filter } }
15 { $description "Records the item as a member of the filter." }
16 { $side-effects "bloom-filter" } ;
17
18 HELP: bloom-filter-member?
19 { $values { "object" object }
20           { "bloom-filter" bloom-filter }
21           { "?" boolean } }
22 { $description "Returns " { $link t } " if the object may be a member of Bloom filter, " { $link f } " otherwise. The false positive rate is configurable; there are no false negatives." } ;
23
24 HELP: bloom-filter
25 { $class-description "This is the class for Bloom filters. These provide constant-time insertion and probabilistic membership-testing operations, but do not actually store any elements." } ;
26
27 ARTICLE: "bloom-filters" "Bloom filters"
28 "This is a library for Bloom filters, sets that provide a constant-time insertion operation and probabilistic membership tests, but do not actually store any elements."
29 $nl
30 "The accuracy of the membership test is configurable; a Bloom filter will never incorrectly report an item is not a member of the set, but may incorrectly report than an item is a member of the set."
31 $nl
32 "Bloom filters cannot be resized and do not support removal."
33 $nl
34 { $subsections
35     <bloom-filter>
36     bloom-filter-insert
37     bloom-filter-member?
38 } ;
39
40 ABOUT: "bloom-filters"