
SnowballStemmer
- Namespace
- Rowles.LeanCorpus.Analysis.Stemmers
- Assembly
- Rowles.LeanCorpus.dll
Abstract base for Snowball-inspired stemmers that apply ordered suffix-removal steps. Each language stemmer supplies its own suffix lists and may override pre-processing, post-processing, and minimum-length thresholds.
public abstract class SnowballStemmer : ISpanStemmer
- Inheritance
-
SnowballStemmer
- Implements
- Derived
MinStemGuard
Minimum characters to preserve after suffix removal.
MinWordLength
Minimum word length required to attempt stemming.
Steps
The suffix-removal rules, grouped by step.
MaxOutputLength(string)
Maximum output length needed (overridden by stemmers that expand input).
Postprocess(Span<char>, int)
Optional post-processing called after all suffix-removal steps. Returns the adjusted length.
Preprocess(ReadOnlySpan<char>, Span<char>)
Optional pre-processing called before suffix removal.
Copies word into output (possibly
transforming it) and returns the new length. Return -1 to use the default
(untransformed copy).
Stem(ReadOnlySpan<char>, Span<char>)
Stems word into output.
Returns the length of the stemmed result, or -1 if output is too small.
The caller must ensure output.Length >= word.Length for guaranteed success.