|
Sautrela | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.gtts.sautrela.wfsa.models.DefaultDWFSA
public class DefaultDWFSA
The default implementation of the DWFSA interface. All information about
States, Symbols and Transitions are statically saved using HashTable-s.
| Nested Class Summary | |
|---|---|
static class |
DefaultDWFSA.InsertionMask
|
| Nested classes/interfaces inherited from interface edu.gtts.sautrela.wfsa.WFSA |
|---|
WFSA.Factory |
| Field Summary | |
|---|---|
static WFSA.Factory |
myFactory
|
| Constructor Summary | |
|---|---|
DefaultDWFSA()
Creates new instance of DefaultDWFSA. |
|
| Method Summary | |
|---|---|
void |
dumpTrainCounts()
Dumps the trained data to the model. |
Alphabet<Symbol> |
getAlphabet()
Returns the alphabet of the Model. |
double |
getFinProb(edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State state)
Returns the probability of being final |
edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State |
getIniState()
Returns the initial State |
java.lang.String |
getName()
Returns the name of the Model. |
DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol> |
getRandomTrans(edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State state)
Returns a random transitions from a state |
Symbol |
getSymbolByName(java.lang.String name)
|
DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>[] |
getTrans(edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State state)
Returns all possible transitions from a state. |
DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol> |
getTrans(edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State state,
Symbol symbol)
Returns the transition for the given state and symbol |
protected void |
gotoStatic()
|
void |
incrementTrainCount(edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State state,
double count)
Increments the training counts associated to a final state. |
void |
incrementTrainCount(DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol> t,
double count)
Increments the training counts associated to a Transition. |
void |
initTrainCounts(double initCount)
Initializes the training counts. |
static void |
main(java.lang.String[] args)
DefaultDWFSA - create a WFSA from a transcription. |
static DefaultDWFSA |
newFromTranscription(java.lang.String[] transcription)
Creates a DefaultDWFSA given a transcription. |
static DefaultDWFSA |
newFromTranscription(java.lang.String name,
java.lang.String[] transcription,
DefaultDWFSA.InsertionMask mask,
java.lang.String insertionSymbol)
Creates a DefaultDWFSA given a transcription and an insertion mask. |
static DefaultDWFSA |
newFromTranscription(java.lang.String name,
java.lang.String[] transcription,
DefaultDWFSA.InsertionMask mask,
java.lang.String insertionSymbol,
Alphabet alphabet)
Creates a DefaultDWFSA given a transcription,an insertion mask and an existing Alphabet. |
void |
setName(java.lang.String name)
Sets the name of the DefaultDWFSA. |
java.lang.String |
toString()
Returns a string representation of the object. |
java.lang.String |
toXML()
Returns a XML representation of the DefaultDWFSA |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final WFSA.Factory myFactory
| Constructor Detail |
|---|
public DefaultDWFSA()
| Method Detail |
|---|
protected void gotoStatic()
public void setName(java.lang.String name)
name - the name of this DefaultDWFSApublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toXML()
toXML in interface WFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>public java.lang.String getName()
WFSA
getName in interface WFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>public Symbol getSymbolByName(java.lang.String name)
public Alphabet<Symbol> getAlphabet()
WFSA
getAlphabet in interface WFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>Alphabetpublic edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State getIniState()
WFSA
getIniState in interface WFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>public DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>[] getTrans(edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State state)
WFSA
getTrans in interface WFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>state - The source State
array must be returned.
public DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol> getTrans(edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State state,
Symbol symbol)
DWFSA
getTrans in interface DWFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>state - the source Statesymbol - the observed symbol
public double getFinProb(edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State state)
WFSA
getFinProb in interface WFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>public DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol> getRandomTrans(edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State state)
WFSA
getRandomTrans in interface WFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>state - The source State
public void initTrainCounts(double initCount)
WFSAinitCount is used as initial posterior probability count
of the WFSA (MAP training). This count must be distributed
among all the internal parameters according to their prior probabilities.
initTrainCounts in interface WFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>initCount - initial posterior probability count
public void incrementTrainCount(edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State state,
double count)
WFSAState.
incrementTrainCount in interface WFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>state - the final Satecount - the training count.
public void incrementTrainCount(DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol> t,
double count)
WFSATransition.
These counts are related to the probability of a Transition.
incrementTrainCount in interface WFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>t - the Transitioncount - the training count.public void dumpTrainCounts()
WFSA
dumpTrainCounts in interface WFSA<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.DefaultDWFSA.State,Symbol>>public static DefaultDWFSA newFromTranscription(java.lang.String[] transcription)
transcription - an array of Strings.
public static DefaultDWFSA newFromTranscription(java.lang.String name,
java.lang.String[] transcription,
DefaultDWFSA.InsertionMask mask,
java.lang.String insertionSymbol,
Alphabet alphabet)
name - The name of the WFSAtranscription - an array of Strings. The strings shouldmask - the InsertionMask to be usedinsertionSymbol - the insertion symbol namealphabet - the alphabet (could grow)
public static DefaultDWFSA newFromTranscription(java.lang.String name,
java.lang.String[] transcription,
DefaultDWFSA.InsertionMask mask,
java.lang.String insertionSymbol)
name - The name of the WFSAtranscription - an array of Strings. The strings shouldmask - the InsertionMask to be usedinsertionSymbol - the insertion symbol name
public static void main(java.lang.String[] args)
throws java.lang.Exception
Syntax: DefaultDWFSA [-lri symbol] name symbol [ symbol ... ]
-ilr symbol Insertion of symbol is allowed (not forced) at the beginning (-l),
between (-i) and at the end (-r) of the transcription symbols.
name name for the DWFSA
symbol transcription symbol.
args - Command line arguments.
java.lang.Exception
|
Sautrela | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||