Section navigation

Public classSealed WordDelimiterFilter

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

Splits compound tokens on word delimiters, case transitions, and letter-digit boundaries.

public sealed class WordDelimiterFilter : ISpanTokenFilter
Inheritance
WordDelimiterFilter
Implements

Remarks

For example, "WiFi4Schools_test" splits into "Wi", "Fi", "4", "Schools", "test". With CatenateWords the filter also emits "WiFi", "Schools", and "WiFiSchools". With PreserveOriginal the original token is emitted too.

Sub-tokens are emitted at the same position (positionIncrement == 0) so downstream filters see them as alternatives.

Public constructor WordDelimiterFilter(char[]?)

Initialises a new WordDelimiterFilter.

Public property CatenateAll

When true, all word and number parts are concatenated and emitted.

Public property CatenateNumbers

When true, runs of number parts are concatenated and emitted.

Public property CatenateWords

When true, runs of word parts are concatenated and emitted.

Public property GenerateNumberParts

When true, number sub-tokens are emitted.

Public property GenerateWordParts

When true, word sub-tokens are emitted.

Public property PreserveOriginal

When true, emit the original token text alongside the split parts.

Public property SplitOnCaseChange

When true, split on lowercase-to-uppercase transitions within a token.

Public property SplitOnNumerics

When true, split between letters and digits.

Public property StemEnglishPossessive

When true, strip trailing English possessives ('s or ') before splitting.

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

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