edu.northwestern.at.utils.corpuslinguistics.wordcounts
Class WordCountAndSentences

java.lang.Object
  extended by edu.northwestern.at.utils.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
 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
WordCountAndSentences()
          Create empty word count and sentences.
WordCountAndSentences(java.lang.Comparable word)
          Create word count and sentences from word.
 
Method Summary
 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.