Class TokenSample

  • All Implemented Interfaces:
    java.io.Serializable

    public class TokenSample
    extends java.lang.Object
    implements java.io.Serializable
    A TokenSample is text with token spans.
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_SEPARATOR_CHARS

        public static final java.lang.String DEFAULT_SEPARATOR_CHARS
        See Also:
        Constant Field Values
    • Constructor Detail

      • TokenSample

        public TokenSample​(java.lang.String text,
                           Span[] tokenSpans)
        Initializes the current instance.
        Parameters:
        text - the text which contains the tokens.
        tokenSpans - the spans which mark the begin and end of the tokens.
      • TokenSample

        public TokenSample​(Detokenizer detokenizer,
                           java.lang.String[] tokens)
    • Method Detail

      • getText

        public java.lang.String getText()
        Retrieves the text.
      • getTokenSpans

        public Span[] getTokenSpans()
        Retrieves the token spans.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • parse

        public static TokenSample parse​(java.lang.String sampleString,
                                        java.lang.String separatorChars)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object