Klasse TokenSample

java.lang.Object
opennlp.tools.tokenize.TokenSample
Alle implementierten Schnittstellen:
Serializable, Sample

public class TokenSample extends Object implements Sample
A TokenSample is text with token spans.
Siehe auch:
  • Felddetails

  • Konstruktordetails

    • TokenSample

      public TokenSample(String text, Span[] tokenSpans)
      Initializes a instance.
      Parameter:
      text - The text which contains the tokens. Must not be null.
      tokenSpans - The spans which mark the start and end of the tokens. Must not be null.
    • TokenSample

      public TokenSample(Detokenizer detokenizer, String[] tokens)
      Initializes a instance via a Detokenizer.
      Parameter:
      detokenizer - The text which contains the tokens. Must not be null.
      tokens - The tokens to be processed. Must not be null.
  • Methodendetails

    • getText

      public String getText()
      Gibt zurück:
      Retrieves the text.
    • getTokenSpans

      public Span[] getTokenSpans()
      Gibt zurück:
      Retrieves the token spans.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • parse

      public static TokenSample parse(String sampleString, String separatorChars)
      Parses a string sample.
      Parameter:
      sampleString - The sample to be parsed. Must not be null.
      separatorChars - The characters to be considered separators. See DEFAULT_SEPARATOR_CHARS. Must not be null.
      Gibt zurück:
      A valid TokenSample instance.
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • equals

      public boolean equals(Object obj)
      Setzt außer Kraft:
      equals in Klasse Object