gov.sandia.cognition.text.spelling
Class SimpleStatisticalSpellingCorrector.Learner

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner<String,SimpleStatisticalSpellingCorrector>
          extended by gov.sandia.cognition.text.spelling.SimpleStatisticalSpellingCorrector.Learner
All Implemented Interfaces:
BatchAndIncrementalLearner<String,SimpleStatisticalSpellingCorrector>, BatchLearner<Collection<? extends String>,SimpleStatisticalSpellingCorrector>, IncrementalLearner<String,SimpleStatisticalSpellingCorrector>, CloneableSerializable, Serializable, Cloneable
Enclosing class:
SimpleStatisticalSpellingCorrector

public static class SimpleStatisticalSpellingCorrector.Learner
extends AbstractBatchAndIncrementalLearner<String,SimpleStatisticalSpellingCorrector>

A learner for the SimpleStatisticalSpellingCorrector.

See Also:
Serialized Form

Field Summary
protected  char[] alphabet
          The alphabet of lower case characters.
 
Constructor Summary
SimpleStatisticalSpellingCorrector.Learner()
          Creates a new simple statistical spelling corrector learner with the default alphabet.
SimpleStatisticalSpellingCorrector.Learner(char[] alphabet)
          Creates a new simple statistical spelling corrector learner with the default alphabet.
 
Method Summary
 SimpleStatisticalSpellingCorrector createInitialLearnedObject()
          Creates a new initial learned object, before any data is given.
 char[] getAlphabet()
          Gets the alphabet of lower-case characters that can be used for replaces and inserts.
 void setAlphabet(char[] alphabet)
          Sets the alphabet of lower-case characters that can be used for replaces and inserts.
 void update(SimpleStatisticalSpellingCorrector target, String word)
          The update method updates an object of ResultType using the given new data of type DataType, using some form of "learning" algorithm.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner
clone, learn, learn, update
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alphabet

protected char[] alphabet
The alphabet of lower case characters.

Constructor Detail

SimpleStatisticalSpellingCorrector.Learner

public SimpleStatisticalSpellingCorrector.Learner()
Creates a new simple statistical spelling corrector learner with the default alphabet.


SimpleStatisticalSpellingCorrector.Learner

public SimpleStatisticalSpellingCorrector.Learner(char[] alphabet)
Creates a new simple statistical spelling corrector learner with the default alphabet.

Parameters:
alphabet - The alphabet of lower-case characters to use.
Method Detail

createInitialLearnedObject

public SimpleStatisticalSpellingCorrector createInitialLearnedObject()
Description copied from interface: IncrementalLearner
Creates a new initial learned object, before any data is given.

Returns:
The initial learned object.

update

public void update(SimpleStatisticalSpellingCorrector target,
                   String word)
Description copied from interface: IncrementalLearner
The update method updates an object of ResultType using the given new data of type DataType, using some form of "learning" algorithm.

Parameters:
target - The object to update.
word - The new data for the learning algorithm to use to update the object.

getAlphabet

public char[] getAlphabet()
Gets the alphabet of lower-case characters that can be used for replaces and inserts.

Returns:
The alphabet of lower-case characters.

setAlphabet

public void setAlphabet(char[] alphabet)
Sets the alphabet of lower-case characters that can be used for replaces and inserts.

Parameters:
alphabet - The alphabet of lower-case characters.