Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (39 sloc) 1.72 KB
#lang scribble/manual
@(require planet/scribble
(for-label (this-package-in main)
@(define my-evaluator (make-base-eval))
@title{porter-stemmer: a packaging of the porter-stemming implementation by Programming Praxis}
@(defmodule/this-package main)
This is a simple packaging of the
implementation} of the
@link[""]{Porter Stemming
Algorithm}; it normalizes English terms to their stems. As a quick
@interaction[#:eval my-evaluator
(require (planet dyoo/porter-stemmer))
(stem "racketeer")
(stem "singing")]
This package provides a single function, @racket[stem]:
@defproc[(stem [a-word string]) string]{
@racket[stem] takes in a single word and removes its morphological
and inflexional endings.
For example:
@interaction[#:eval my-evaluator
(stem "smiling")
(stem "frowned")
(map stem (regexp-split #px"\\s"
(string-append "What are the roots that clutch, what branches grow\n"
"Out of this stony rubbish?")))]
Caveat: note that the stemmer does not deal with punctuation.
This package is derived from the
Stemming} article from
@link[""]{Programming Praxis}. As with
the original code, this is under the @link[""]{Creative Commons
Attribution-Noncommercial-Share Alike 3.0 United States