|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarf.Stats.StatisticalObject
marf.Stats.WordStats
marf.Stats.Observation
marf.Stats.Ngram
public class Ngram
N-gram Observation.
$Id: Ngram.java,v 1.16 2007/12/18 21:57:14 mokhov Exp $
| Field Summary |
|---|
| Fields inherited from class marf.Stats.Observation |
|---|
bSeen, dPosteriorProbability, dPriorProbability |
| Fields inherited from class marf.Stats.StatisticalObject |
|---|
iFrequency, iRank |
| Constructor Summary | |
|---|---|
Ngram()
Constructs an unigram. |
|
Ngram(int piSize)
Constructs an N-gram of the specified size. |
|
Ngram(Ngram poNgram)
Copy-constructor. |
|
Ngram(Ngram[] paoNgramElements)
Constructs an N-gram out of the N-gram elements. |
|
| Method Summary | |
|---|---|
void |
addNgram(Ngram poNgram)
Adds an N-gram at the end of the N-gram elements array. |
java.lang.Object |
clone()
Implements Cloneable interface for the Ngram object. |
int |
getCapacity()
Allows querying for the current capacity of the N-gram (how many elements are actually there). |
static java.lang.String |
getMARFSourceCodeRevision()
Returns source code revision information. |
Ngram[] |
getNgramElements()
Allows querying for the contained N-gram elements. |
int |
getSize()
Retrieves the size of the N-gram. |
void |
setNgram(int piIndex,
Ngram poNgram)
Sets an N-gram at a specified index. |
| Methods inherited from class marf.Stats.Observation |
|---|
getPosteriorProbability, getPriorProbability, markAsSeen, setPosteriorProbability, setPriorProbability, wasSeen |
| Methods inherited from class marf.Stats.WordStats |
|---|
getLexeme, toString |
| Methods inherited from class marf.Stats.StatisticalObject |
|---|
equals, getFrequency, getRank, hashCode, incFrequency, incRank, setRank |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Ngram()
public Ngram(int piSize)
piSize - Npublic Ngram(Ngram[] paoNgramElements)
paoNgramElements - the N-gram array to make a copy frompublic Ngram(Ngram poNgram)
poNgram - Ngram object to copy properties of| Method Detail |
|---|
public void setNgram(int piIndex,
Ngram poNgram)
piIndex - the indexpoNgram - the n-gram
java.lang.ArrayIndexOutOfBoundsException - if the index is outside the valid rangepublic void addNgram(Ngram poNgram)
poNgram - the N-gram to add.
java.lang.ArrayIndexOutOfBoundsException - the N-gram being added exceeds the initial capacitypublic final int getSize()
public final Ngram[] getNgramElements()
public final int getCapacity()
public java.lang.Object clone()
clone in class ObservationObject.clone()public static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||