edu.northwestern.at.morphadorner.corpuslinguistics.textsegmenter

## Class AbstractTextSegmenter

- java.lang.Object
- - edu.northwestern.at.utils.IsCloseableObject
  - - edu.northwestern.at.morphadorner.corpuslinguistics.textsegmenter.AbstractTextSegmenter

- All Implemented Interfaces:
    TextSegmenter, IsCloseable, UsesLogger
  Direct Known Subclasses:
    C99TextSegmenter, TextTilingTextSegmenter

      public abstract class AbstractTextSegmenter
      extends IsCloseableObject
      implements TextSegmenter, IsCloseable, UsesLogger

  Base class for segmenting a text.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Logger` | `logger` Logger used for output.
    `protected Stemmer` | `stemmer` Stemmer.
    `protected StopWords` | `stopWords` Stop words.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractTextSegmenter()` Create a text segmenter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Logger` | `getLogger()` Get the logger.
    `abstract <T> java.util.List<java.lang.Integer>` | `getSegmentPositions(java.util.List<java.util.List<T>> sentences)` Segment text.
    `Stemmer` | `getStemmer()` Get the stemmer.
    `StopWords` | `getStopWords()` Get the stop words.
    `void` | `setLogger(Logger logger)` Set the logger.
    `void` | `setStemmer(Stemmer stemmer)` Set stop word set.
    `void` | `setStopWords(StopWords stopWords)` Set stop word set.

    - ### Methods inherited from class edu.northwestern.at.utils.IsCloseableObject

      `close`

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

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

    - ### Methods inherited from interface edu.northwestern.at.utils.IsCloseable

      `close`

- - ### Field Detail

    - #### logger

          protected Logger logger

      Logger used for output.

    - #### stopWords

          protected StopWords stopWords

      Stop words.

    - #### stemmer

          protected Stemmer stemmer

      Stemmer.

  - ### Constructor Detail

    - #### AbstractTextSegmenter

          public AbstractTextSegmenter()

      Create a text segmenter.

  - ### Method Detail

    - #### getLogger

          public Logger getLogger()

      Get the logger.
      Specified by:
        `getLogger` in interface `UsesLogger`
      Returns:
        The logger.

    - #### setLogger

          public void setLogger(Logger logger)

      Set the logger.
      Specified by:
        `setLogger` in interface `UsesLogger`
      Parameters:
        `logger` - The logger.

    - #### getStopWords

          public StopWords getStopWords()

      Get the stop words.
      Returns:
        The stop words.

    - #### setStopWords

          public void setStopWords(StopWords stopWords)

      Set stop word set.
      Parameters:
        `stopWords` - The stop words.

    - #### getStemmer

          public Stemmer getStemmer()

      Get the stemmer.
      Returns:
        The stemmer.

    - #### setStemmer

          public void setStemmer(Stemmer stemmer)

      Set stop word set.
      Parameters:
        `stemmer` - The stemmer.

    - #### getSegmentPositions

          public abstract <T> java.util.List<java.lang.Integer> getSegmentPositions(java.util.List<java.util.List<T>> sentences)

      Segment text.
      Specified by:
        `getSegmentPositions` in interface `TextSegmenter`
      Parameters:
        `sentences` - The list of tokenized sentences to segment.
      Returns:
        A list of sentence indices which start a new text segment.