A simplified Porter stemming algorithm for English.
Reduces words to their root form:
- "running" → "run"
- "runner" → "run"
- "runs" → "run"
This is not a full Porter stemmer but covers the most common English suffixes. It is good enough for practical search use cases while keeping the implementation simple and fast.
For production use with other languages, consider integrating a purpose-built stemming library.
Summary
Functions
Stems a single term to its root form.
Stems a list of terms, removing duplicates after stemming.
Functions
Stems a single term to its root form.
Returns the original term unchanged if no stemming rule applies.
Examples
iex> Stemmer.stem("running")
"run"
iex> Stemmer.stem("runs")
"run"
iex> Stemmer.stem("easily")
"easili"
iex> Stemmer.stem("elixir")
"elixir"
Stems a list of terms, removing duplicates after stemming.