marf.Stats
Class Ngram

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 $
Author:
Serguei Mokhov
See Also:
Serialized Form

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(marf.Stats.Ngram[] paNgramElements)
          Constructs an N-gram out of the N-gram elements.
 
Method Summary
 void addNgram(marf.Stats.Ngram poNgram)
          Adds an N-gram at the end of the N-gram elements array.
static java.lang.String getMARFSourceCodeRevision()
          Returns source code revision information.
 int getSize()
          Retrievs the size of the N-gram.
 void setNgram(int piIndex, marf.Stats.Ngram poNgram)
          Sets an N-gram at a specified index.
 
Methods inherited from class marf.Stats.WordStats
getLexeme
 
Methods inherited from class marf.Stats.StatisticalObject
getFrequency, getRank, incFrequency, incRank, setRank
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ngram

public Ngram()
Constructs an unigram.


Ngram

public Ngram(int piSize)
Constructs an N-gram of the specified size.

Parameters:
piSize - N

Ngram

public Ngram(marf.Stats.Ngram[] paNgramElements)
Constructs an N-gram out of the N-gram elements. Makes a deep copy of the parameter array.

Parameters:
paNgramElements -
Method Detail

setNgram

public void setNgram(int piIndex,
                     marf.Stats.Ngram poNgram)
Sets an N-gram at a specified index.

Parameters:
piIndex - the index
poNgram - the n-gram

addNgram

public void addNgram(marf.Stats.Ngram poNgram)
Adds an N-gram at the end of the N-gram elements array.

Parameters:
poNgram - the N-gram to add.

getSize

public final int getSize()
Retrievs the size of the N-gram.

Returns:
N

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Returns source code revision information.

Returns:
revision string