]> gitweb.factorcode.org Git - factor.git/blob - basis/porter-stemmer/porter-stemmer-docs.factor
Append input history to ~/.factor-history upon UI Listener ending
[factor.git] / basis / porter-stemmer / porter-stemmer-docs.factor
1 USING: help.markup help.syntax strings ;
2 IN: porter-stemmer
3
4 HELP: step1a
5 { $values { "str" string } { "newstr" "a new string" } }
6 { $description "Gets rid of plurals." }
7 { $examples
8     { $table
9         { { $strong "Input" } { $strong "Output" } }
10         { "caresses" "caress" }
11         { "ponies" "poni" }
12         { "ties" "ti" }
13         { "caress" "caress" }
14         { "cats" "cat" }
15     }
16 } ;
17
18 HELP: step1b
19 { $values { "str" string } { "newstr" "a new string" } }
20 { $description "Gets rid of \"-ed\" and \"-ing\" suffixes." }
21 { $examples
22     { $table
23         { { $strong "Input" } { $strong "Output" } }
24         { "feed"  "feed" }
25         { "agreed"  "agree" }
26         { "disabled"  "disable" }
27         { "matting"  "mat" }
28         { "mating"  "mate" }
29         { "meeting"  "meet" }
30         { "milling"  "mill" }
31         { "messing"  "mess" }
32         { "meetings"  "meet" }
33     }
34 } ;
35
36 HELP: step1c
37 { $values { "str" string } { "newstr" "a new string" } }
38 { $description "Turns a terminal y to i when there is another vowel in the stem." } ;
39
40 HELP: step2
41 { $values { "str" string } { "newstr" "a new string" } }
42 { $description "Maps double suffices to single ones. so -ization maps to -ize etc. note that the string before the suffix must give positive " { $link consonant-seq } "." } ;
43
44 HELP: step3
45 { $values { "str" string } { "newstr" "a new string" } }
46 { $description "Deals with -c-, -full, -ness, etc. Similar strategy to " { $link step2 } "." } ;
47
48 HELP: step5
49 { $values { "str" string } { "newstr" "a new string" } }
50 { $description "Removes a final -e and changes a final -ll to -l if " { $link consonant-seq } " is greater than 1," } ;
51
52 HELP: stem
53 { $values { "str" string } { "newstr" "a new string" } }
54 { $description "Applies the Porter stemming algorithm to the input string." } ;
55
56 ARTICLE: "porter-stemmer" "Porter stemming algorithm"
57 "The help system uses the Porter stemming algorithm to normalize words when building the full-text search index."
58 $nl
59 "The Factor implementation of the algorithm is based on the Common Lisp version, which was hand-translated from ANSI C by Steven M. Haflich. The original ANSI C was written by Martin Porter."
60 $nl
61 "A detailed description of the algorithm, along with implementations in various languages, can be at in " { $url "http://www.tartarus.org/~martin/PorterStemmer" } "."
62 $nl
63 "The main word of the algorithm takes an English word as input and outputs its stem:"
64 { $subsections stem }
65 "The algorithm consists of a number of steps:"
66 { $subsections
67     step1a
68     step1b
69     step1c
70     step2
71     step3
72     step4
73     step5
74 } ;
75
76 ABOUT: "porter-stemmer"