Stem - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

StringTools

 Stem
 attempt to derive an English word stem using Porter's algorithm

 Calling Sequence Stem( word )

Parameters

 word - Maple string; English word

Description

 • The Stem(word) command attempts to process the English language word word, using (currently) Porter's algorithm. See publication reference at the bottom of this help page.
 • Porter's algorithm processes words by removing recognizable suffixes of a word until the stem of the word is left. The algorithm does not guarantee that a minimal word stem will be produced, and does not remove word prefixes. The algorithm is suitable only for English language words.
 • The maximum length of the input string word is 127 characters (which is sufficient for any English language word).
 • One typical use of a stemmer for a spelling checker is as follows. A word list or dictionary, is prepared by applying the stemmer to each of its members, resulting in a list of stemmed dictionary words. This reduces the size of the dictionary that must be searched, since a typical word list may have multiple words with the same word stem. An input word is checked for validity by comparing its word stem against the dictionary of stemmed words. The input word is considered valid if its word stem belongs to the stemmed dictionary.
 • A second typical use of a stemmer is in forming document collection indices for searching. For example, an index of a website can be prepared by stemming all the significant words that occur in the titles of the webpages on that site. A search query consisting of a number of words is processed with the stemmer, and a list of the documents that are indexed by the stemmed search terms is returned.
 • All of the StringTools package commands treat strings as (null-terminated) sequences of $8$-bit (ASCII) characters.  Thus, there is no support for multibyte character encodings, such as unicode encodings.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{Stem}\left("helpful"\right)$
 ${"help"}$ (1)
 > $\mathrm{Stem}\left("helping"\right)$
 ${"help"}$ (2)
 > $\mathrm{Stem}\left("helped"\right)$
 ${"help"}$ (3)
 > $\mathrm{Stem}\left("helper"\right)$
 ${"helper"}$ (4)
 > $\mathrm{Stem}\left("hopeful"\right)$
 ${"hope"}$ (5)
 > $\mathrm{Stem}\left("hopefully"\right)$
 ${"hopefulli"}$ (6)
 > $\mathrm{Stem}\left("absolutely"\right)$
 ${"absolut"}$ (7)
 > $\mathrm{Stem}\left("antinuclear"\right)$
 ${"antinuclear"}$ (8)

References

 Porter, M. F. "An algorithm for suffix stripping." Program, Vol. 14 No. 3. (July 1980): 130-137.