Sautrela

edu.gtts.sautrela.wfsa.models
Class KTLSS

java.lang.Object
  extended by edu.gtts.sautrela.wfsa.models.KTLSS
All Implemented Interfaces:
DWFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>, WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>

public class KTLSS
extends java.lang.Object
implements DWFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>

Author:
mpenagar

Nested Class Summary
 class KTLSS.OOVSymbol
           
 class KTLSS.Symbol
           
 
Nested classes/interfaces inherited from interface edu.gtts.sautrela.wfsa.WFSA
WFSA.Factory
 
Field Summary
static WFSA.Factory myFactory
           
 
Method Summary
 void dumpTrainCounts()
          Dumps the trained data to the model.
 Alphabet<KTLSS.Symbol> getAlphabet()
          Returns the alphabet of the Model.
 double getFinProb(edu.gtts.sautrela.wfsa.models.KTLSS.Node node)
          Returns the probability of being final
 double getGopalakrishnanC()
           
 edu.gtts.sautrela.wfsa.models.KTLSS.Node getIniState()
          Returns the initial State
 java.lang.String getName()
          Returns the name of the Model.
 DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol> getRandomTrans(edu.gtts.sautrela.wfsa.models.KTLSS.Node node)
          Returns a random transitions from a state
 DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>[] getTrans(edu.gtts.sautrela.wfsa.models.KTLSS.Node node)
          Returns all possible transitions from a state.
 DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol> getTrans(edu.gtts.sautrela.wfsa.models.KTLSS.Node src, KTLSS.Symbol sy)
          Returns the transition for the given state and symbol
 void incrementTrainCount(DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol> t, double count)
          Increments the training counts associated to a Transition.
 void incrementTrainCount(edu.gtts.sautrela.wfsa.models.KTLSS.Node node, double count)
          Increments the training counts associated to a final state.
 void initTrainCounts(double initCount)
          Initializes the training counts.
static void main(java.lang.String[] args)
           
 void setGopalakrishnanC(double d)
           
 java.lang.String toString()
          Returns a string representation of the KTLS.
 java.lang.String toXML()
          Returns a XML representation of the KTLS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myFactory

public static final WFSA.Factory myFactory
Method Detail

toString

public java.lang.String toString()
Returns a string representation of the KTLS.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of the KTLS

getName

public java.lang.String getName()
Description copied from interface: WFSA
Returns the name of the Model.

Specified by:
getName in interface WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>
Returns:
The name of the Model

getAlphabet

public Alphabet<KTLSS.Symbol> getAlphabet()
Description copied from interface: WFSA
Returns the alphabet of the Model.

Specified by:
getAlphabet in interface WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>
Returns:
The Alphabet

getIniState

public edu.gtts.sautrela.wfsa.models.KTLSS.Node getIniState()
Description copied from interface: WFSA
Returns the initial State

Specified by:
getIniState in interface WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>
Returns:
The initial state

getTrans

public DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>[] getTrans(edu.gtts.sautrela.wfsa.models.KTLSS.Node node)
Description copied from interface: WFSA
Returns all possible transitions from a state.

Specified by:
getTrans in interface WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>
Parameters:
node - The source State
Returns:
an array containing all possible transitions from a state. If there is no transition, and empty array must be returned.

getTrans

public DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol> getTrans(edu.gtts.sautrela.wfsa.models.KTLSS.Node src,
                                                                                         KTLSS.Symbol sy)
Description copied from interface: DWFSA
Returns the transition for the given state and symbol

Specified by:
getTrans in interface DWFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>
Parameters:
src - the source State
sy - the observed symbol
Returns:
the transition for the given state and symbol, or null if the transition does not exists

getFinProb

public double getFinProb(edu.gtts.sautrela.wfsa.models.KTLSS.Node node)
Description copied from interface: WFSA
Returns the probability of being final

Specified by:
getFinProb in interface WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>
Returns:
The probability of being final

getRandomTrans

public DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol> getRandomTrans(edu.gtts.sautrela.wfsa.models.KTLSS.Node node)
Description copied from interface: WFSA
Returns a random transitions from a state

Specified by:
getRandomTrans in interface WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>
Parameters:
node - The source State
Returns:
a random transition

toXML

public java.lang.String toXML()
Returns a XML representation of the KTLS

Specified by:
toXML in interface WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>
Returns:
a String containing the XML representation

initTrainCounts

public void initTrainCounts(double initCount)
Description copied from interface: WFSA
Initializes the training counts. Al previous counts are cleared and initCount 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.

Specified by:
initTrainCounts in interface WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>
Parameters:
initCount - initial posterior probability count

incrementTrainCount

public void incrementTrainCount(edu.gtts.sautrela.wfsa.models.KTLSS.Node node,
                                double count)
Description copied from interface: WFSA
Increments the training counts associated to a final state. These counts are related to the final probability of a State.

Specified by:
incrementTrainCount in interface WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>
Parameters:
node - the final Sate
count - the training count.

incrementTrainCount

public void incrementTrainCount(DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol> t,
                                double count)
Description copied from interface: WFSA
Increments the training counts associated to a Transition. These counts are related to the probability of a Transition.

Specified by:
incrementTrainCount in interface WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>
Parameters:
t - the Transition
count - the training count.

dumpTrainCounts

public void dumpTrainCounts()
Description copied from interface: WFSA
Dumps the trained data to the model.

Specified by:
dumpTrainCounts in interface WFSA<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol,DefaultTransition<edu.gtts.sautrela.wfsa.models.KTLSS.Node,KTLSS.Symbol>>

getGopalakrishnanC

public double getGopalakrishnanC()

setGopalakrishnanC

public void setGopalakrishnanC(double d)

main

public static void main(java.lang.String[] args)

Sautrela