Section navigation

Public classSealed CountingTokenSink

Namespace
Rowles.LeanCorpus.Analysis.Analysers
Assembly
Rowles.LeanCorpus.dll

An ISpanTokenSink that counts accepted tokens without allocating any strings or Token objects. Use for performance measurement of the analysis pipeline when only throughput matters, not the tokens themselves.

public sealed class CountingTokenSink : ISpanTokenSink
Inheritance
CountingTokenSink
Implements

Public property Count

Gets the number of tokens accepted since the last Reset().

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

Adds a token to the sink.

Public method Reset()

Resets the token count to zero.