Class TokenSample
A TokenSample is text with token spans.
public class TokenSample
- Inheritance
-
TokenSample
- Inherited Members
Constructors
TokenSample(IDetokenizer, string[])
public TokenSample(IDetokenizer detokenizer, string[] tokens)
Parameters
detokenizerIDetokenizertokensstring[]
TokenSample(string, Span[])
Initializes the current instance.
public TokenSample(string text, Span[] tokenSpans)
Parameters
textstringthe text which contains the tokens.
tokenSpansSpan[]the spans which mark the begin and end of the tokens.
Fields
DEFAULT_SEPARATOR_CHARS
public const string DEFAULT_SEPARATOR_CHARS = "<SPLIT>"
Field Value
Properties
Text
Retrieves the text.
public virtual string Text { get; }
Property Value
TokenSpans
Retrieves the token spans.
public virtual Span[] TokenSpans { get; }
Property Value
- Span[]
Methods
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Parse(string, string)
public static TokenSample Parse(string sampleString, string separatorChars)
Parameters
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.