Package cc.mallet.fst
Class SumLatticeDefault
- java.lang.Object
-
- cc.mallet.fst.SumLatticeDefault
-
- All Implemented Interfaces:
SumLattice
- Direct Known Subclasses:
SumLatticeConstrained
public class SumLatticeDefault extends java.lang.Object implements SumLattice
Default, full dynamic programming implementation of the Forward-Backward "Sum-(Product)-Lattice" algorithm
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SumLatticeDefault.Factory
protected class
SumLatticeDefault.LatticeNode
-
Field Summary
Fields Modifier and Type Field Description protected static boolean
saveXis
-
Constructor Summary
Constructors Modifier Constructor Description protected
SumLatticeDefault()
SumLatticeDefault(Transducer trans, Sequence input)
SumLatticeDefault(Transducer trans, Sequence input, boolean saveXis)
SumLatticeDefault(Transducer trans, Sequence input, Transducer.Incrementor incrementor)
SumLatticeDefault(Transducer trans, Sequence input, Sequence output)
SumLatticeDefault(Transducer trans, Sequence input, Sequence output, Transducer.Incrementor incrementor)
SumLatticeDefault(Transducer trans, Sequence input, Sequence output, Transducer.Incrementor incrementor, boolean saveXis)
SumLatticeDefault(Transducer trans, Sequence input, Sequence output, Transducer.Incrementor incrementor, boolean saveXis, LabelAlphabet outputAlphabet)
SumLatticeDefault(Transducer trans, Sequence input, Sequence output, Transducer.Incrementor incrementor, LabelAlphabet outputAlphabet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getAlpha(int ip, Transducer.State s)
double
getBeta(int ip, Transducer.State s)
double
getGammaProbability(int inputPosition, int stateIndex)
double
getGammaProbability(int inputPosition, Transducer.State s)
double[][]
getGammas()
double
getGammaWeight(int inputPosition, int stateIndex)
double
getGammaWeight(int inputPosition, Transducer.State s)
Sequence
getInput()
LabelVector
getLabelingAtPosition(int outputPosition)
protected SumLatticeDefault.LatticeNode
getLatticeNode(int ip, int stateIndex)
double
getTotalWeight()
Transducer
getTransducer()
double
getXiProbability(int ip, Transducer.State s1, Transducer.State s2)
double[][][]
getXis()
double
getXiWeight(int ip, Transducer.State s1, Transducer.State s2)
int
length()
-
-
-
Constructor Detail
-
SumLatticeDefault
protected SumLatticeDefault()
-
SumLatticeDefault
public SumLatticeDefault(Transducer trans, Sequence input)
-
SumLatticeDefault
public SumLatticeDefault(Transducer trans, Sequence input, boolean saveXis)
-
SumLatticeDefault
public SumLatticeDefault(Transducer trans, Sequence input, Transducer.Incrementor incrementor)
-
SumLatticeDefault
public SumLatticeDefault(Transducer trans, Sequence input, Sequence output)
-
SumLatticeDefault
public SumLatticeDefault(Transducer trans, Sequence input, Sequence output, Transducer.Incrementor incrementor)
-
SumLatticeDefault
public SumLatticeDefault(Transducer trans, Sequence input, Sequence output, Transducer.Incrementor incrementor, LabelAlphabet outputAlphabet)
-
SumLatticeDefault
public SumLatticeDefault(Transducer trans, Sequence input, Sequence output, Transducer.Incrementor incrementor, boolean saveXis)
-
SumLatticeDefault
public SumLatticeDefault(Transducer trans, Sequence input, Sequence output, Transducer.Incrementor incrementor, boolean saveXis, LabelAlphabet outputAlphabet)
-
-
Method Detail
-
getLatticeNode
protected SumLatticeDefault.LatticeNode getLatticeNode(int ip, int stateIndex)
-
getXis
public double[][][] getXis()
- Specified by:
getXis
in interfaceSumLattice
-
getGammas
public double[][] getGammas()
- Specified by:
getGammas
in interfaceSumLattice
-
getTotalWeight
public double getTotalWeight()
- Specified by:
getTotalWeight
in interfaceSumLattice
-
getGammaWeight
public double getGammaWeight(int inputPosition, Transducer.State s)
- Specified by:
getGammaWeight
in interfaceSumLattice
-
getGammaWeight
public double getGammaWeight(int inputPosition, int stateIndex)
-
getGammaProbability
public double getGammaProbability(int inputPosition, Transducer.State s)
- Specified by:
getGammaProbability
in interfaceSumLattice
-
getGammaProbability
public double getGammaProbability(int inputPosition, int stateIndex)
-
getXiProbability
public double getXiProbability(int ip, Transducer.State s1, Transducer.State s2)
- Specified by:
getXiProbability
in interfaceSumLattice
-
getXiWeight
public double getXiWeight(int ip, Transducer.State s1, Transducer.State s2)
- Specified by:
getXiWeight
in interfaceSumLattice
-
length
public int length()
- Specified by:
length
in interfaceSumLattice
-
getInput
public Sequence getInput()
- Specified by:
getInput
in interfaceSumLattice
-
getAlpha
public double getAlpha(int ip, Transducer.State s)
- Specified by:
getAlpha
in interfaceSumLattice
-
getBeta
public double getBeta(int ip, Transducer.State s)
- Specified by:
getBeta
in interfaceSumLattice
-
getLabelingAtPosition
public LabelVector getLabelingAtPosition(int outputPosition)
- Specified by:
getLabelingAtPosition
in interfaceSumLattice
-
getTransducer
public Transducer getTransducer()
- Specified by:
getTransducer
in interfaceSumLattice
-
-