Section navigation

Public classSealed JapaneseStemmer

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

Japanese stemmer — identity implementation.

public sealed class JapaneseStemmer : ISpanStemmer
Inheritance
JapaneseStemmer
Implements

Remarks

Japanese morphology is handled by conjugation paradigms (活用), not detachable suffixes of the kind that a Snowball-style stemmer can reliably strip. Inflected verb and adjective forms are interleaved with auxiliary morphemes (e.g. 食べられる, 走っている) that require a full morphological analyser to decompose correctly.

Recommended pre-processing for Japanese search:

  • Morphological analysis with MeCab, Kuromoji, or SudachiPy
  • Lemmatisation using the analyser's dictionary base-form output
  • Kana normalisation (hiragana ↔ katakana, full-width → half-width)

This class is provided so the ISpanStemmer pipeline compiles uniformly across all supported languages.

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 the stemmed string.