Package opennlp.tools.sentdetect

# 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:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SentenceSample(CharSequence document, Span... sentences)`
  Initializes the current instance.
  `SentenceSample(Detokenizer detokenizer, String[][] sentences)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `String`
  `getDocument()`
  `Span[]`
  `getSentences()`
  `int`
  `hashCode()`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## 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`