edu.northwestern.at.wordhoard.model.counts
Class WordCount

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.counts.WordCount
All Implemented Interfaces:
PersistentObject, java.io.Serializable

public class WordCount
extends java.lang.Object
implements java.io.Serializable, PersistentObject

Counts for work parts.

These count objects provide summary statistics at the level of work parts. Given a work part, we can quickly provide fequency counts for spellings, lemmas, word classes, speaker gender and mortality attributes, prose vs. verse, and metrical shapes. We use a number of indices on this table to optimize different kinds of queries.

A word count object contains the following fields:

The text of the count object has the following form, depending on the kind of word form being counted.

The LEMMA and WORDCLASS counters are counts over word parts. The other forms are all counts over words.

Counts for work parts include their subparts. E.g., the counts for Act 2 of Hamlet sum up the counts for all the scenes in the act, and the counts for the work Hamlet sum up the counts for the entire work.

These count objects are used by the calculator.

See Also:
Serialized Form

Constructor Summary
WordCount()
          Create an empty word form count object.
WordCount(Spelling word, int wordForm, WorkPart workPart, Work work, int wordCount)
          Create a populated word form count object.
 
Method Summary
 java.lang.Long getId()
          Get the persistence id.
 Spelling getWord()
          Get the word text.
 int getWordCount()
          Get the word count in the work part.
 int getWordForm()
          Get the word form.
 Work getWork()
          Get the work.
 WorkPart getWorkPart()
          Get the work part.
protected  void setWord(Spelling word)
          Set the word text.
 java.lang.String toString()
          Return string form of this entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WordCount

public WordCount()
Create an empty word form count object.


WordCount

public WordCount(Spelling word,
                 int wordForm,
                 WorkPart workPart,
                 Work work,
                 int wordCount)
Create a populated word form count object.

Method Detail

getId

public java.lang.Long getId()
Get the persistence id.

Specified by:
getId in interface PersistentObject
Returns:
The persistence id.

getWord

public Spelling getWord()
Get the word text.

Returns:
The word text.

setWord

protected void setWord(Spelling word)
Set the word text.

Parameters:
word - The word text.

getWordForm

public int getWordForm()
Get the word form.

Returns:
The word form type.

getWorkPart

public WorkPart getWorkPart()
Get the work part.

Returns:
The work part.

getWork

public Work getWork()
Get the work.

Returns:
The work.

getWordCount

public int getWordCount()
Get the word count in the work part.

Returns:
The word count in the work part.

toString

public java.lang.String toString()
Return string form of this entry.

Overrides:
toString in class java.lang.Object
Returns:
The word form text.