java.lang.Object
marf.Stats.StatisticalObject
marf.Stats.WordStats
marf.Stats.Observation
marf.Stats.Ngram
- All Implemented Interfaces:
- java.io.Serializable
- public class Ngram
- extends Observation
N-gram Observation.
$Id: Ngram.java,v 1.14 2005/08/14 01:15:56 mokhov Exp $
- Since:
- 0.3.0.2
- Version:
- $Revision: 1.14 $
|
Field Summary |
private Ngram[] |
aNgramElements
N-gram's parts. |
private int |
iCapacity
N-gram's current capacity. |
private int |
iSize
0 - unset, 1 - unigram, 2 - bigram, 3 - trigram, etc. |
private static long |
serialVersionUID
For serialization versioning. |
| Fields inherited from class marf.Stats.WordStats |
|
|
Constructor Summary |
Ngram()
Constructs an unigram. |
Ngram(int piSize)
Constructs an N-gram of the specified size. |
Ngram(Ngram[] paNgramElements)
Constructs an N-gram out of the N-gram elements. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- For serialization versioning.
When adding new members or make other structural
changes regenerate this number with the
serialver tool that comes with JDK.
- Since:
- 0.3.0.4
- See Also:
- Constant Field Values
iSize
private int iSize
- 0 - unset, 1 - unigram, 2 - bigram, 3 - trigram, etc.
iCapacity
private int iCapacity
- N-gram's current capacity.
Default is 0.
aNgramElements
private Ngram[] aNgramElements
- N-gram's parts.
Ngram
public Ngram()
- Constructs an unigram.
Ngram
public Ngram(int piSize)
- Constructs an N-gram of the specified size.
Ngram
public Ngram(Ngram[] paNgramElements)
- Constructs an N-gram out of the N-gram elements.
Makes a deep copy of the parameter array.
setNgram
public void setNgram(int piIndex,
Ngram poNgram)
- Sets an N-gram at a specified index.
addNgram
public void addNgram(Ngram poNgram)
- Adds an N-gram at the end of the N-gram elements array.
getSize
public final int getSize()
- Retrievs the size of the N-gram.
getMARFSourceCodeRevision
public static java.lang.String getMARFSourceCodeRevision()
- Returns source code revision information.