edu.northwestern.at.morphadorner.corpuslinguistics.sentencesplitter

## Class ICU4JBreakIteratorSentenceSplitterIterator

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.sentencesplitter.ICU4JBreakIteratorSentenceSplitterIterator

- All Implemented Interfaces:
    SentenceSplitterIterator
  Direct Known Subclasses:
    DefaultSentenceSplitterIterator

      public class ICU4JBreakIteratorSentenceSplitterIterator
      extends java.lang.Object
      implements SentenceSplitterIterator

  BreakIterator-based sentence splitter iterator.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `end` End of current sentence.
    `protected com.ibm.icu.text.BreakIterator` | `sentenceExtractor` BreakIterator used to iterate over sentences.
    `protected int` | `start` Start of current sentence.
    `protected java.lang.String` | `text` Text to break up.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ICU4JBreakIteratorSentenceSplitterIterator()` Create sentence iterator.
    `ICU4JBreakIteratorSentenceSplitterIterator(java.util.Locale locale)` Create sentence iterator with specified locale.
    `ICU4JBreakIteratorSentenceSplitterIterator(java.lang.String text)` Create sentence iterator over text.
    `ICU4JBreakIteratorSentenceSplitterIterator(java.lang.String text, java.util.Locale locale)` Create sentence iterator over text with specified locale.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()` Check if there is another sentence available.
    `java.lang.String` | `next()` Return next sentence.
    `java.lang.String` | `peek()` Return next sentence without advancing sentence pointer.
    `void` | `setText(java.lang.String text)` Set the text to split.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### sentenceExtractor

          protected com.ibm.icu.text.BreakIterator sentenceExtractor

      BreakIterator used to iterate over sentences.

    - #### start

          protected int start

      Start of current sentence.

    - #### end

          protected int end

      End of current sentence.

    - #### text

          protected java.lang.String text

      Text to break up.

  - ### Constructor Detail

    - #### ICU4JBreakIteratorSentenceSplitterIterator

          public ICU4JBreakIteratorSentenceSplitterIterator()

      Create sentence iterator.

    - #### ICU4JBreakIteratorSentenceSplitterIterator

          public ICU4JBreakIteratorSentenceSplitterIterator(java.util.Locale locale)

      Create sentence iterator with specified locale.
      Parameters:
        `locale` - The locale.

    - #### ICU4JBreakIteratorSentenceSplitterIterator

          public ICU4JBreakIteratorSentenceSplitterIterator(java.lang.String text)

      Create sentence iterator over text.
      Parameters:
        `text` - The text from which to extract sentences.

    - #### ICU4JBreakIteratorSentenceSplitterIterator

          public ICU4JBreakIteratorSentenceSplitterIterator(java.lang.String text,
                                                    java.util.Locale locale)

      Create sentence iterator over text with specified locale.
      Parameters:
        `text` - The text from which to extract sentences.
        `locale` - The locale.

  - ### Method Detail

    - #### setText

          public void setText(java.lang.String text)

      Set the text to split.
      Specified by:
        `setText` in interface `SentenceSplitterIterator`
      Parameters:
        `text` - Text to split.

    - #### hasNext

          public boolean hasNext()

      Check if there is another sentence available.
      Specified by:
        `hasNext` in interface `SentenceSplitterIterator`
      Returns:
        true if another sentence is available.

    - #### next

          public java.lang.String next()

      Return next sentence.
      Specified by:
        `next` in interface `SentenceSplitterIterator`
      Returns:
        next sentence, or null if none.

    - #### peek

          public java.lang.String peek()

      Return next sentence without advancing sentence pointer.
      Specified by:
        `peek` in interface `SentenceSplitterIterator`
      Returns:
        next sentence, or null if none.