From 0b60d6cc4ce8e5d4f3c9abb6591f98920cbec8f0 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Thu, 4 Apr 2013 16:06:01 -0700 Subject: [PATCH] bloom-filters: fix docs. --- extra/bloom-filters/bloom-filters-docs.factor | 4 ++-- extra/bloom-filters/bloom-filters-tests.factor | 2 +- extra/bloom-filters/bloom-filters.factor | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/bloom-filters/bloom-filters-docs.factor b/extra/bloom-filters/bloom-filters-docs.factor index 9df586f468..9718738ba5 100644 --- a/extra/bloom-filters/bloom-filters-docs.factor +++ b/extra/bloom-filters/bloom-filters-docs.factor @@ -3,10 +3,10 @@ IN: bloom-filters HELP: { $values { "error-rate" "The desired false positive rate. A " { $link float } " between 0 and 1." } - { "number-objects" "The expected number of object in the set. A positive " { $link integer } "." } + { "capacity" "The expected number of object in the set. A positive " { $link integer } "." } { "bloom-filter" bloom-filter } } { $description "Creates an empty Bloom filter." } -{ $errors "Throws a " { $link capacity-error } " when unable to produce a filter meeting the given constraints. Throws a " { $link invalid-error-rate } " or a " { $link invalid-n-objects } " when input is invalid." } ; +{ $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." } ; HELP: bloom-filter-insert diff --git a/extra/bloom-filters/bloom-filters-tests.factor b/extra/bloom-filters/bloom-filters-tests.factor index 06a84e3dd3..9c933230e8 100644 --- a/extra/bloom-filters/bloom-filters-tests.factor +++ b/extra/bloom-filters/bloom-filters-tests.factor @@ -23,7 +23,7 @@ IN: bloom-filters.tests [ 4 32 ] [ 0.05 5 size-bloom-filter ] unit-test ! This is a lot of bits. -[ 0.00000001 max-array-capacity size-bloom-filter ] [ capacity-error? ] must-fail-with +[ 0.00000001 max-array-capacity size-bloom-filter ] [ invalid-size? ] must-fail-with ! Other error conditions. [ 1.0 2000 ] [ invalid-error-rate? ] must-fail-with diff --git a/extra/bloom-filters/bloom-filters.factor b/extra/bloom-filters/bloom-filters.factor index 04d5ec1d37..e5e14d48fb 100644 --- a/extra/bloom-filters/bloom-filters.factor +++ b/extra/bloom-filters/bloom-filters.factor @@ -49,7 +49,7 @@ TUPLE: bloom-filter { capacity fixnum read-only } { count fixnum } ; -ERROR: capacity-error ; +ERROR: invalid-size ; ERROR: invalid-error-rate error-rate ; ERROR: invalid-capacity capacity ; @@ -73,7 +73,7 @@ ERROR: invalid-capacity capacity ; ! If the number of hashes isn't positive, we haven't found ! anything smaller than the identity configuration. : check-hashes ( 2seq -- 2seq ) - dup first 0 <= [ capacity-error ] when ; + dup first 0 <= [ invalid-size ] when ; ! The consensus on the tradeoff between increasing the number of ! bits and increasing the number of hash functions seems to be