marf.Classification.Stochastic
Class ZipfLaw

java.lang.Object
  extended by marf.Storage.StorageManager
      extended by marf.Classification.Classification
          extended by marf.Classification.Stochastic.Stochastic
              extended by marf.Classification.Stochastic.ZipfLaw
All Implemented Interfaces:
java.io.Serializable, IClassification, IStorageManager

public class ZipfLaw
extends Stochastic

Module exercising Zipf's Law.

$Id: ZipfLaw.java,v 1.13 2005/06/16 19:58:43 mokhov Exp $

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

Field Summary
 
Fields inherited from class marf.Classification.Classification
oFeatureExtraction, oResultSet, oTrainingSet
 
Fields inherited from class marf.Storage.StorageManager
bDumpOnNotFound, iCurrentDumpMode, oObjectToSerialize, strFilename
 
Fields inherited from interface marf.Classification.IClassification
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
ZipfLaw(IFeatureExtraction poFeatureExtraction)
          Classification API.
ZipfLaw(java.lang.String pstrStatsFilename)
          Takes a filename argument.
 
Method Summary
 void collectStatistics(java.io.StreamTokenizer st)
          Collects result statistics.
 void dumpAll()
          Dumps results to STDOUT.
 void dumpGraphValues()
          Dumps CVS values of the rank and frequency into a file.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 void rankAll()
          Ranks results.
 
Methods inherited from class marf.Classification.Stochastic.Stochastic
classify, dump, getResult, restore, train
 
Methods inherited from class marf.Classification.Classification
getResultSet, getTrainingSetFilename
 
Methods inherited from class marf.Storage.StorageManager
backSynchronizeObject, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipfLaw

public ZipfLaw(java.lang.String pstrStatsFilename)
Takes a filename argument.

Parameters:
pstrStatsFilename - the desired file to process

ZipfLaw

public ZipfLaw(IFeatureExtraction poFeatureExtraction)
Classification API.

Parameters:
poFeatureExtraction - preprcessing module to get the data from
Method Detail

collectStatistics

public final void collectStatistics(java.io.StreamTokenizer st)
                             throws ClassificationException
Collects result statistics. TODO: employ StatsCollector.

Parameters:
st - desired stream tokenizer
Throws:
ClassificationException - in case of innder exceptions

rankAll

public final void rankAll()
Ranks results.


dumpAll

public final void dumpAll()
Dumps results to STDOUT.


dumpGraphValues

public final void dumpGraphValues()
                           throws java.io.IOException
Dumps CVS values of the rank and frequency into a file. Filename is composed from the orginal corpus name plus the .csv extension. By default the dump is in the log() scale.

Throws:
java.io.IOException

getMARFSourceCodeRevision

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

Returns:
revision string