An English (Porter2) stemming implementation in Elixir.
In linguistic morphology and information retrieval, stemming is the process of reducing inflected (or sometimes derived) words to their word stem, base or root form—generally a written word form. The stem need not be identical to the morphological root of the word; it is usually sufficient that related words map to the same stem, even if this stem is not in itself a valid root. - Wikipedia
The Stemmer.stem/1
function supports stemming a single word (String
), a sentence (String
) or a list of single words (List
of String
s).
Stemmer.stem("capabilities") # => "capabl"
Stemmer.stem("extraordinary capabilities") # => "extraordinari capabl"
Stemmer.stem(["extraordinary", "capabilities"]) # => ["extraordinari", "capabl"]
Stemmer is 100% compatible with the official Porter2 implementation, it is tested against the official diffs.txt
which contains more than 29000 words.
Stemmer was built to support the Simple Bayes library.
Licensed under MIT.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。