marf.Stats.StatisticalEstimators
Class StatisticalEstimator

java.lang.Object
  extended by marf.Storage.StorageManager
      extended by marf.Stats.StatisticalEstimators.StatisticalEstimator
All Implemented Interfaces:
java.io.Serializable, IStatisticalEstimator, IStorageManager
Direct Known Subclasses:
GLI, KatzBackoff, SLI, Smoothing

public abstract class StatisticalEstimator
extends StorageManager
implements IStatisticalEstimator

Implements generic Statistical Estimator routines. Must be subclasses by concrete implemenations of statistical estimators.

$Id: StatisticalEstimator.java,v 1.24 2005/06/16 19:58:47 mokhov Exp $

Since:
0.3.0
Version:
$Revision: 1.24 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
protected  ProbabilityTable oProbabilityTable
           
protected  NLPStreamTokenizer oStreamTokenizer
           
 
Fields inherited from class marf.Storage.StorageManager
bDumpOnNotFound, iCurrentDumpMode, oObjectToSerialize, strFilename
 
Fields inherited from interface marf.Stats.StatisticalEstimators.IStatisticalEstimator
MARF_INTERFACE_CODE_REVISION
 
Fields inherited from interface marf.Storage.IStorageManager
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_HTML, DUMP_SQL, DUMP_XML, MARF_INTERFACE_CODE_REVISION, STORAGE_FILE_EXTENSIONS
 
Constructor Summary
StatisticalEstimator()
           
 
Method Summary
 void dumpCSV()
          Not implemented.
 void dumpXML()
          Not implemented.
 java.lang.String getFilename()
          Retrieves inner filename reference.
 java.lang.String getLanguage()
          Retrieves current language.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 ProbabilityTable getProbabilityTable()
          Retrieves current ProbabilityTable.
 NLPStreamTokenizer getStreamTokenizer()
          Retrieves current StreamTokenizer.
 double p()
          N-gram-based classification.
 java.lang.String resetFilename()
           
 void restoreCSV()
          Not implemented.
 void restoreXML()
          Not implemented.
 void setLanguage(java.lang.String pstrLang)
          Allows altering current language being processed.
 void setStreamTokenizer(NLPStreamTokenizer poStreamTokenizer)
          Sets desired StreamTokenizer.
 boolean train()
          Every estimator needs to implement its specific training method.
 
Methods inherited from class marf.Storage.StorageManager
backSynchronizeObject, dump, dumpBinary, dumpGzipBinary, dumpHTML, dumpSQL, enableDumpOnNotFound, getDefaultExtension, getDefaultExtension, getDumpMode, restore, restoreBinary, restoreGzipBinary, restoreHTML, restoreSQL, setDumpMode, setFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

oProbabilityTable

protected ProbabilityTable oProbabilityTable

oStreamTokenizer

protected NLPStreamTokenizer oStreamTokenizer
Constructor Detail

StatisticalEstimator

public StatisticalEstimator()
Method Detail

p

public final double p()
N-gram-based classification.

Specified by:
p in interface IStatisticalEstimator
Returns:
calculated probability value

train

public boolean train()
Every estimator needs to implement its specific training method.

Specified by:
train in interface IStatisticalEstimator
Returns:
true if training was successful

dumpCSV

public void dumpCSV()
             throws StorageException
Not implemented.

Specified by:
dumpCSV in interface IStorageManager
Overrides:
dumpCSV in class StorageManager
Throws:
StorageException - never thrown
See Also:
StorageManager.dump()

dumpXML

public void dumpXML()
             throws StorageException
Not implemented.

Specified by:
dumpXML in interface IStorageManager
Overrides:
dumpXML in class StorageManager
Throws:
StorageException - never thrown
See Also:
StorageManager.dump()

restoreCSV

public void restoreCSV()
                throws StorageException
Not implemented.

Specified by:
restoreCSV in interface IStorageManager
Overrides:
restoreCSV in class StorageManager
Throws:
StorageException - never thrown
See Also:
StorageManager.restore()

restoreXML

public void restoreXML()
                throws StorageException
Not implemented.

Specified by:
restoreXML in interface IStorageManager
Overrides:
restoreXML in class StorageManager
Throws:
StorageException - never thrown
See Also:
StorageManager.restore()

setStreamTokenizer

public final void setStreamTokenizer(NLPStreamTokenizer poStreamTokenizer)
Description copied from interface: IStatisticalEstimator
Sets desired StreamTokenizer.

Specified by:
setStreamTokenizer in interface IStatisticalEstimator
Parameters:
poStreamTokenizer - StreamTokenizer or a derivative to use for tokens
See Also:
NLPStreamTokenizer

getStreamTokenizer

public NLPStreamTokenizer getStreamTokenizer()
Description copied from interface: IStatisticalEstimator
Retrieves current StreamTokenizer.

Specified by:
getStreamTokenizer in interface IStatisticalEstimator
Returns:
oStreamTokenizer beeing used

getProbabilityTable

public ProbabilityTable getProbabilityTable()
Description copied from interface: IStatisticalEstimator
Retrieves current ProbabilityTable.

Specified by:
getProbabilityTable in interface IStatisticalEstimator
Returns:
oStreamTokenizer beeing used
See Also:
ProbabilityTable

setLanguage

public final void setLanguage(java.lang.String pstrLang)
Description copied from interface: IStatisticalEstimator
Allows altering current language being processed.

Specified by:
setLanguage in interface IStatisticalEstimator
Parameters:
pstrLang - desired language

getLanguage

public final java.lang.String getLanguage()
Description copied from interface: IStatisticalEstimator
Retrieves current language.

Specified by:
getLanguage in interface IStatisticalEstimator
Returns:
language name of language being processed

resetFilename

public final java.lang.String resetFilename()

getFilename

public final java.lang.String getFilename()
Description copied from class: StorageManager
Retrieves inner filename reference.

Overrides:
getFilename in class StorageManager
Returns:
filename string

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Retrieves class' revision.

Returns:
revision string