de.aitools.ir.retrievalmodels.representer
Class SerializableTermFrequency

java.lang.Object
  extended by de.aitools.ir.retrievalmodels.representer.AbstractRepresenter<java.lang.String,Vector>
      extended by de.aitools.ir.retrievalmodels.representer.TermFrequency
          extended by de.aitools.ir.retrievalmodels.representer.SerializableTermFrequency
All Implemented Interfaces:
Representer<java.lang.String,Vector>, java.io.Serializable

public class SerializableTermFrequency
extends TermFrequency
implements java.io.Serializable

This class is not as performant as the original TermFrequency class, but it is serializable and thats just what I needed. Instead of holding instances of the used Stemmer, StopwordList and Decomposer as member variables it instantiates these objects for every represent-method call.

Author:
jgomoll
See Also:
Serialized Form

Constructor Summary
SerializableTermFrequency(java.util.Locale l, boolean stemWords, boolean filterStopwords)
           
 
Method Summary
 boolean isTrained()
           
 Vector represent(java.lang.String text)
           
 void train(java.lang.Iterable<java.lang.String> documents, boolean forceTraining)
           
 
Methods inherited from class de.aitools.ir.retrievalmodels.representer.TermFrequency
getDecomposer, getSpaceGrowable, getStemmer, getStopwords, getVectorSpace, setDecomposer, setSpaceGrowable, setStemmer, setStopwords, setVectorSpace
 
Methods inherited from class de.aitools.ir.retrievalmodels.representer.AbstractRepresenter
train
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializableTermFrequency

public SerializableTermFrequency(java.util.Locale l,
                                 boolean stemWords,
                                 boolean filterStopwords)
Method Detail

train

public void train(java.lang.Iterable<java.lang.String> documents,
                  boolean forceTraining)
Specified by:
train in interface Representer<java.lang.String,Vector>
Overrides:
train in class TermFrequency

isTrained

public boolean isTrained()
Specified by:
isTrained in interface Representer<java.lang.String,Vector>
Overrides:
isTrained in class TermFrequency

represent

public Vector represent(java.lang.String text)
Specified by:
represent in interface Representer<java.lang.String,Vector>
Overrides:
represent in class TermFrequency