Stemming¶
To stem text, do an HTTP POST to http://text-processing.com/api/stem/ with form encoded data containg the text you want to stem. You’ll get back a JSON object response whose text attribute contains the stemmed text. Here’s some examples of how to do it using curl:
$ curl -d "text=processing" http://text-processing.com/api/stem/
{
        "text": "process"
}
How to specify a stemmer other than porter, in this case wordnet:
$ curl -d "text=processing&stemmer=wordnet" http://text-processing.com/api/stem/
{
        "text": "processing"
}
Using the snowball stemmer with spanish:
$ curl -d "text=correr&stemmer=snowball&language=spanish" http://text-processing.com/api/stem/
{
        "text": "corr"
}
Specifying just the language, which in the case of portuguese defaults to using the snowball stemmer:
$ curl -d "text=correr&language=portuguese" http://text-processing.com/api/stem/
{
        "text": "corr"
}
Try out the stemming demo to get a feel for the results.
Paramterers¶
- text:
 Required - the text you want to stem. It must not exceed 60,000 characters.
- language:
 The default
languageisenglish, unless a non-english stemmer is given. In that case, the value oflanguagemust be compatible with the chosenstemmer. Currently, the following languages are supported:arabicenglishdanishdutchfinnishfrenchgermanhungarianitaliannorwegianportugueseromanianrussianspanishswedish
The
snowballstemmer is the defaultstemmerfor all languages exceptenglishandarabic, which default toporterandisrirespectively.- stemmer:
 The
stemmerparameter supports the following valuesporterThe default porter stemmer supports any
languagebut defaults toenglishlancasterA lancaster stemmer that supports any language but defaults to
englishwordnetLemmatization using WordNet, only supports
englishrslpA
portuguesestemmerisriAn
arabicstemmersnowballA stemmer that supports the following languages
danishdutchenglishfinnishfrenchgermanhungarianitaliannorwegianporterportugueseromanianrussianspanishswedish
If you give both a
stemmerand alanguage, thestemmermust support that language. Bothporterandlancastercan be used with any language, whilewordnet,rslp, andisriare limited to their respective languages. Thesnowballstemmer currently supports 14 languages, and is the defaultstemmerfor those languages.
Return Value¶
On success, a 200 OK response will be returned containing a JSON object that looks like this:
{
        "text": "stemmed text"
}
Errors¶
A 400 Bad Request response will be returned under the following conditions:
the
languageis not compatible with thestemmerno value for
textis providedtextexceeds 60,000 characters
A 503 Throttled response will be returned if you exceed the daily request limit. Signup for the Text-Processing RapidAPI to get a higher limit plan.