stem
1 Acknowledgements
Version: 5.2.0.901

porter-stemmer: a packaging of the porter-stemming implementation by Programming Praxis

 (require (planet dyoo/porter-stemmer:1:=2))

This is a simple packaging of the reference implementation of the Porter Stemming Algorithm; it normalizes English terms to their stems. As a quick example:

> (require (planet dyoo/porter-stemmer))
> (stem "racketeer")

"racket"

> (stem "singing")

"sing"

This package provides a single function, stem:

(stem a-word)  string
  a-word : string
stem takes in a single word and removes its morphological and inflexional endings.

For example:
> (stem "smiling")

"smile"

> (stem "frowned")

"frown"

> (map stem (regexp-split #px"\\s"
                          (string-append "What are the roots that clutch, what branches grow\n"
                                         "Out of this stony rubbish?")))

'("what"

  "ar"

  "the"

  "root"

  "that"

  "clutch,"

  "what"

  "branch"

  "grow"

  "out"

  "of"

  "thi"

  "stoni"

  "rubbish?")

Caveat: note that the stemmer does not deal with punctuation.

1 Acknowledgements

This package is derived from the Porter Stemming article from Programming Praxis. As with the original code, this is under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.