
SpanToken
- Namespace
- Rowles.LeanCorpus.Analysis
- Assembly
- Rowles.LeanCorpus.dll
Represents token data whose text is a span over the analysed input.
public readonly ref struct SpanToken
Remarks
The token text is only valid while the source input remains in scope. Use this type for allocation-aware tokenisation pipelines that consume tokens immediately.
SpanToken(ReadOnlySpan<char>, int, int, string, int, byte[]?)
Initialises a new SpanToken.
EndOffset
Gets the exclusive end character offset in the original input.
Payload
Gets the optional payload bytes for this token.
PositionIncrement
Gets the position increment relative to the previous emitted token.
StartOffset
Gets the start character offset in the original input.
Text
Gets the token text span.
Type
Gets the token type.