Commit aeae80c1 authored by Mirko Hannemann's avatar Mirko Hannemann
Browse files

LatticeToFstMapper


git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@599 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent a2cf8ebd
...@@ -206,6 +206,31 @@ class StdToLatticeMapper { ...@@ -206,6 +206,31 @@ class StdToLatticeMapper {
uint64 Properties(uint64 props) { return props; } uint64 Properties(uint64 props) { return props; }
}; };
/// Class LatticeToStdMapper maps a LatticeArc to a normal arc (StdArc)
/// by adding the elements of the LatticeArc weight.
template<class Int>
class LatticeToStdMapper {
typedef LatticeWeightTpl<Int> LatticeWeight;
typedef ArcTpl<LatticeWeight> LatticeArc;
public:
StdArc operator()(const LatticeArc &arc) {
return StdArc(arc.ilabel, arc.olabel,
StdArc::Weight(arc.weight.Value1() + arc.weight.Value2()),
arc.nextstate);
}
MapFinalAction FinalAction() { return MAP_NO_SUPERFINAL; }
MapSymbolsAction InputSymbolsAction() { return MAP_COPY_SYMBOLS; }
MapSymbolsAction OutputSymbolsAction() { return MAP_COPY_SYMBOLS; }
// I believe all properties are preserved.
uint64 Properties(uint64 props) { return props; }
};
template<class Weight, class Int> template<class Weight, class Int>
void PruneCompactLattice( void PruneCompactLattice(
Weight beam, Weight beam,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment