factor/library/help/search.facts

40 lines
2.0 KiB
Plaintext

IN: help
USING: namespaces ;
HELP: ignored-word?
{ $values { "string" "a string" } } { $description "Tests for English stop words." } ;
HELP: tokenize
{ $values { "string" "a string" } { "seq" "a sequence of strings" } }
{ $description "Split a string along whitespace boundaries, convert all tokens to lower case, stem all tokens, and discards one-letter words and stop words." } ;
HELP: index-text
{ $values { "topic" "a help article name or a word" } { "string" "a string" } }
{ $description "Tokenizes the string and adds each token to the term index." }
{ $notes "This word operates on the current namespace, and so must be wrapped in a " { $link bind } " to specify the term index hashtable." } ;
HELP: index-article
{ $values { "topic" "a help article name or a word" } }
{ $description "Adds the tokens making up the article to the term index." } ;
HELP: term-index
{ $var-description "A hashtable mapping stemmed search terms to hashtables mapping help topics to relevancy scores."
$terpri
"The " { $link search-help } " word searches the term index and the " { $link index-help } " word updates it." }
{ $see-also help } ;
HELP: count-occurrences
{ $values { "seq" "a sequence of hashtables" } { "hash" "a hashtable" } }
{ $description "Collates all keys from the hashtables in " { $snippet "seq" } " and sums their values, which must be numbers." } ;
HELP: search-help
{ $values { "phrase" "a string" } { "assoc" "a sequence of pairs" } }
{ $description "Performs a full-text search in the term index for help topics relating to " { $snippet "phrase" } ". The result is an association list of topic names paired with scores, sorted by decreasing score." } ;
HELP: index-help
{ $description "Updates the full-text search term index for use by " { $link search-help. } " and " { $link search-help } "." } ;
HELP: search-help.
{ $values { "phrase" "a string" } }
{ $description "Performs a full-text search in the term index for help topics relating to " { $snippet "phrase" } ", and prints an outliner with the results." } ;