edu.northwestern.at.morphadorner.corpuslinguistics.wordcounts

## Class WordCountAndSentences

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.wordcounts.WordCountAndSentences

- All Implemented Interfaces:
    java.lang.Comparable

      public class WordCountAndSentences
      extends java.lang.Object
      implements java.lang.Comparable

  Contains a word, its count, and sentence numbers in which it appears.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `count` The word count.
    `java.util.Set<java.lang.Integer>` | `sentences` Set of sentence numbers in which the word appears.
    `java.lang.Comparable` | `word` The word.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WordCountAndSentences()` Create empty word count and sentences.
    `WordCountAndSentences(java.lang.Comparable word)` Create word count and sentences from word.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(java.lang.Object other)` Compare this count data object with another.
    `java.lang.String` | `toString()` Return string representation of word counts and sentences.

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

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

- - ### Field Detail

    - #### word

          public java.lang.Comparable word

      The word. Usually a String or AdornedWord.

    - #### count

          public int count

      The word count.

    - #### sentences

          public java.util.Set<java.lang.Integer> sentences

      Set of sentence numbers in which the word appears.

  - ### Constructor Detail

    - #### WordCountAndSentences

          public WordCountAndSentences()

      Create empty word count and sentences.

    - #### WordCountAndSentences

          public WordCountAndSentences(java.lang.Comparable word)

      Create word count and sentences from word.

  - ### Method Detail

    - #### compareTo

          public int compareTo(java.lang.Object other)

      Compare this count data object with another.
      Specified by:
        `compareTo` in interface `java.lang.Comparable`
      Parameters:
        `other` - The count data object
      Returns:
        < 0 if this count data object is less than the other, = 0 if the two count data objects are equal, > 0 if this count data object is greater than the other.

    - #### toString

          public java.lang.String toString()

      Return string representation of word counts and sentences.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        String representation.