ExNlp.Snowball (ex_nlp v0.1.0)
View SourceUnified interface for Snowball stemming algorithms.
This module provides a consistent API for stemming words across multiple languages.
Supported Languages
:english- English stemming using Porter2 algorithm:spanish- Spanish stemming:portuguese- Portuguese stemming:french- French stemming:german- German stemming:italian- Italian stemming:polish- Polish stemming
Examples
iex> ExNlp.Snowball.stem("running", :english)
"run"
iex> ExNlp.Snowball.stem("caminando", :spanish)
"camin"
iex> ExNlp.Snowball.stem("the", :english, ignore_stopwords: true)
"the"
iex> ExNlp.Snowball.stem("running", :english, ignore_stopwords: false)
"run"
Summary
Functions
Stems a word in the specified language.
Stems multiple words.
Checks if a language is supported.
Returns the list of supported languages.
Functions
Stems a word in the specified language.
Arguments
word- The word to stem (string)language- The language atom (:english,:spanish, etc.)opts- Keyword list of optionsignore_stopwords- Iftrue, returns stopwords unchanged (default:false)
Returns
The stemmed word as a string.
Examples
iex> ExNlp.Snowball.stem("running", :english)
"run"
iex> ExNlp.Snowball.stem("beautifully", :english)
"beauti"
Stems multiple words.
Examples
iex> ExNlp.Snowball.stem_words(["running", "jumping"], :english)
["run", "jump"]
Checks if a language is supported.
Examples
iex> ExNlp.Snowball.supported?(:english)
true
iex> ExNlp.Snowball.supported?(:japanese)
false
Returns the list of supported languages.
Examples
iex> ExNlp.Snowball.supported_languages()
[:english, :spanish, :portuguese, :french, :german, :italian, :polish]