TokenSpan class final

A tokenised word span together with its character offsets in the original text.

start is inclusive and end is exclusive, both measured in UTF-16 code units — i.e. Dart String index space, matching String.substring (so text.substring(span.start, span.end) == span.text always holds).

Constructors

TokenSpan(String text, int start, int end)
Creates a TokenSpan.
const

Properties

end int
The exclusive end offset of this token in the source text.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start int
The inclusive start offset of this token in the source text.
final
text String
The token's text — identical to what Tokenizer.tokenise would have returned for this span.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override