edu.northwestern.at.morphadorner.corpuslinguistics.textsummarizer

## Class AbstractTextSummarizer

- java.lang.Object
- - edu.northwestern.at.utils.IsCloseableObject
  - - edu.northwestern.at.morphadorner.corpuslinguistics.textsummarizer.AbstractTextSummarizer

- All Implemented Interfaces:
    TextSummarizer, IsCloseable, UsesLogger
  Direct Known Subclasses:
    SimpleTextSummarizer

      public abstract class AbstractTextSummarizer
      extends IsCloseableObject
      implements TextSummarizer, IsCloseable, UsesLogger

  Base class for summarizing a text.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Logger` | `logger` Logger used for output.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractTextSummarizer()` Create a word tokenizer.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Logger` | `getLogger()` Get the logger.
    `void` | `setLogger(Logger logger)` Set the logger.
    `<T extends java.lang.Comparable> java.util.List<java.lang.Integer>` | `summarize(java.util.List<java.util.List<T>> sentences)` Summarize text.
    `abstract <T extends java.lang.Comparable> java.util.List<java.lang.Integer>` | `summarize(java.util.List<java.util.List<T>> sentences, int summarySentences)` Summarize text.

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

  - ### Constructor Detail

    - #### AbstractTextSummarizer

          public AbstractTextSummarizer()

      Create a word tokenizer.

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

    - #### summarize

          public <T extends java.lang.Comparable> java.util.List<java.lang.Integer> summarize(java.util.List<java.util.List<T>> sentences)

      Summarize text.
      Specified by:
        `summarize` in interface `TextSummarizer`
      Parameters:
        `sentences` - Tokenized sentences to summarize.
      Returns:
        Summary of the input text. The maximum number of sentences returned is 10% of the original.

    - #### summarize

          public abstract <T extends java.lang.Comparable> java.util.List<java.lang.Integer> summarize(java.util.List<java.util.List<T>> sentences,
                                                                                     int summarySentences)

      Summarize text.
      Specified by:
        `summarize` in interface `TextSummarizer`
      Parameters:
        `sentences` - Tokenized sentences to summarize.
        `summarySentences` - Maximum number of sentences to return in the summary.
      Returns:
        Summary of the input text.