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

    • SentenceSample

      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

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

    • getDocument

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

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

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

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

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