com.aliasi.lm
Interface LanguageModel.Dynamic

All Superinterfaces:
Compilable, LanguageModel
All Known Implementing Classes:
NGramBoundaryLM, NGramProcessLM, TokenizedLM, UniformBoundaryLM, UniformProcessLM
Enclosing interface:
LanguageModel

public static interface LanguageModel.Dynamic
extends Compilable, LanguageModel

A LanguageModel.Dynamic accepts training events in the form of character slices or sequences. A dynamic language model should also implement either the LanguageModel.Process interface or the LanguageModel.Sequence interface.

Optionally, a dynamic language model will implement the Compilable.compileTo(ObjectOutput) method to write a compiled version of the dynamic language model to an object output stream.

Since:
LingPipe2.0
Version:
2.4
Author:
Bob Carpenter

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.aliasi.lm.LanguageModel
LanguageModel.Conditional, LanguageModel.Dynamic, LanguageModel.Process, LanguageModel.Sequence, LanguageModel.Tokenized
 
Method Summary
 void train(char[] cs, int start, int end)
          Update the model with the training data provided by the specified character slice.
 void train(char[] cs, int start, int end, int count)
          Update the model with the training data provided by the specified character sequence with the specifiedc count.
 void train(CharSequence cs)
          Update the model with the training data provided by the specified character sequence with a count of one.
 void train(CharSequence cs, int count)
          Update the model with the training data provided by the specified character sequence with the specified count.
 
Methods inherited from interface com.aliasi.util.Compilable
compileTo
 
Methods inherited from interface com.aliasi.lm.LanguageModel
log2Estimate, log2Estimate
 

Method Detail

train

void train(CharSequence cs)
Update the model with the training data provided by the specified character sequence with a count of one.

Parameters:
cs - The character sequence to use as training data.

train

void train(CharSequence cs,
           int count)
Update the model with the training data provided by the specified character sequence with the specified count. Calling this method, train(cs,n) is equivalent to calling train(cs) a total of n times.

Parameters:
cs - The character sequence to use as training data.
count - Number of instances to train.

train

void train(char[] cs,
           int start,
           int end)
Update the model with the training data provided by the specified character slice.

Parameters:
cs - The underlying character array for the slice.
start - Index of first character in the slice.
end - Index of one plus the last character in the training slice.
Throws:
IndexOutOfBoundsException - If the end index minus one and the start index are not in the range of the character slice.

train

void train(char[] cs,
           int start,
           int end,
           int count)
Update the model with the training data provided by the specified character sequence with the specifiedc count. Calling this method, train(cs,n) is equivalent to calling train(cs) a total of n times. Update the model with the training data provided by the specified character slice.

Parameters:
cs - The underlying character array for the slice.
start - Index of first character in the slice.
end - Index of one plus the last character in the training slice.
count - Number of instances to train.
Throws:
IndexOutOfBoundsException - If the end index minus one and the start index are not in the range of the character slice.