mmir.grammar.stemmer
Word stemming
Methods
-
staticmmir.grammar.stemmer.stem(word){String}
-
Simplified German snowball stemmer:
Really simple JavaScript stemmer based on the Snowball stemmer http://snowball.tartarus.org/algorithms/german/stemmer.html Some simplifications were made, e.g. ignoring R2 and the special provision for words ending in -isse-
Name Type Description word
String the (German) word that should be stemmed Properties:
Name Type Description allowUmlauts
Boolean allow umlauts in stemmed words (DEFAULT: false
)Returns:
Type Description String the stemmed word Example
mmir.require(['mmirf/stemmer'], function(stem){ var strStemmed = stem('abspielen'); // -> "abspiel" var strStemmedUmlauts = stem('anhören'); // -> "anhor" // disable stemming umlauts // (by default, umlauts will be "normalized") stem.allowUmlauts = true; var strWithUmlauts = stem('anhören'); // -> "anhör" });