|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.concept.WordCount
Maintains a map of word count / document name. Used to generate word statistics on documents. Keeps a map of document names and the number of times that the word occurred in the document.
| Constructor Summary | |
WordCount(java.lang.String word)
|
|
| Method Summary | |
void |
addCounts(WordCount counts)
|
void |
addDocument(java.lang.String documentName)
|
void |
addDocument(java.lang.String documentName,
int[] wordPositions)
|
double |
getAverageWordDensity(java.util.HashMap docWordCountMap)
|
double |
getAverageWordDensity(java.util.HashMap docWordCountMap,
int minDocSize)
Returns average word density. |
java.util.Map |
getDocumentCounts()
|
double |
getDocumentFrequency(int totalDocuments)
returns ratio of number of documents that this word occurs in to total documents. |
int |
getMaxWordsIn()
|
int |
getNumberOfDocuments()
|
int |
getTotalCounts()
returns the total number of times the word occurred in the set of documents. |
java.lang.String |
getWord()
|
int[] |
getWordPositions(java.lang.String docKey)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public WordCount(java.lang.String word)
| Method Detail |
public java.lang.String getWord()
public java.util.Map getDocumentCounts()
public void addDocument(java.lang.String documentName)
public void addDocument(java.lang.String documentName,
int[] wordPositions)
public void addCounts(WordCount counts)
public double getDocumentFrequency(int totalDocuments)
public int getTotalCounts()
public double getAverageWordDensity(java.util.HashMap docWordCountMap)
public double getAverageWordDensity(java.util.HashMap docWordCountMap,
int minDocSize)
docWordCountMap - map of Document name to total number of Words in document.minDocSize - minimum of words per document that will be used. If minDocSize <= 0
all documents will be used to compute average density.public int getNumberOfDocuments()
public int getMaxWordsIn()
public int[] getWordPositions(java.lang.String docKey)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||