Class SentenceSample

java.lang.Object
opennlp.tools.sentdetect.SentenceSample
All Implemented Interfaces:
Serializable, Sample

public class SentenceSample extends Object implements Sample
A SentenceSample contains a document with begin indexes of the individual sentences.
See Also:
  • Constructor Details Link icon

    • SentenceSample Link icon

      public SentenceSample(CharSequence document, Span... sentences)
      Initializes the current instance.
      Parameters:
      document - The document represented as plain CharSequence.
      sentences - One or more spans that represent a sentence each.
    • SentenceSample Link icon

      public SentenceSample(Detokenizer detokenizer, String[][] sentences)
  • Method Details Link icon

    • getDocument Link icon

      public String getDocument()
      Returns:
      the document as a plain string.
    • getSentences Link icon

      public Span[] getSentences()
      Returns:
      the spans of the sentences in a document.
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals Link icon

      public boolean equals(Object obj)
      Overrides:
      equals in class Object