Section navigation

Public classSealed ClassicFilter

Namespace
Rowles.LeanCorpus.Analysis.Filters
Assembly
Rowles.LeanCorpus.dll

Removes possessive endings and periods from acronyms, replicating Lucene's ClassicFilter.

public sealed class ClassicFilter : ISpanTokenFilter
Inheritance
ClassicFilter
Implements

Remarks

  • Strips trailing 's or 'S from tokens (English possessive).
  • Removes periods from tokens that consist entirely of uppercase letters and periods (e.g. "U.S.A." becomes "USA").
  • Tokens that require neither transformation are forwarded unchanged with zero allocation.

Public method Apply(ReadOnlySpan<char>, int, int, string, int, byte[]?, ISpanTokenSink)

Applies the filter to a token and emits the transformed token into sink.