Section navigation

Public classSealed KStemmer

Namespace
Rowles.LeanCorpus.Analysis.Stemmers
Assembly
Rowles.LeanCorpus.dll

Lexicon-validated English stemmer inspired by Krovetz stemming.

public sealed class KStemmer : ISpanStemmer
Inheritance
KStemmer
Implements

Public constructor KStemmer(IKStemLexicon)

Initialises a new KStemmer with the supplied base-form lexicon.

Public method 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.

Public method Stem(string)

Convenience overload returning a stemmed string.

Public method StemPreLowered(ReadOnlySpan<char>, Span<char>)

Same as Stem(ReadOnlySpan{char}, Span{char}) but assumes the input is already lowercased. Callers who have already lowercased via LowercaseFilter can use this to avoid a redundant per-character ToLowerInvariant pass.