#include <determinize-lattice-inl.h>
Classes | |
struct | Element |
class | PairComparator |
class | SubsetEqual |
class | SubsetEqualStates |
class | SubsetKey |
struct | TempArc |
Public Types | |
typedef CompactLatticeWeightTpl< Weight, IntType > | CompactWeight |
typedef ArcTpl< CompactWeight > | CompactArc |
typedef ArcTpl< Weight > | Arc |
Public Member Functions | |
void | Output (MutableFst< CompactArc > *ofst, bool destroy=true) |
void | Output (MutableFst< Arc > *ofst, bool destroy=true) |
LatticeDeterminizer (const Fst< Arc > &ifst, DeterminizeLatticeOptions opts) | |
void | FreeMostMemory () |
~LatticeDeterminizer () | |
void | RebuildRepository () |
bool | CheckMemoryUsage () |
bool | Determinize (bool *debug_ptr) |
Private Types | |
enum | IsymbolOrFinal { OSF_UNKNOWN = 0, OSF_NO = 1, OSF_YES = 2 } |
typedef Arc::Label | Label |
typedef Arc::StateId | StateId |
typedef Arc::StateId | InputStateId |
typedef Arc::StateId | OutputStateId |
typedef LatticeStringRepository< IntType > | StringRepositoryType |
typedef const StringRepositoryType::Entry * | StringId |
typedef std::unordered_map< const std::vector< Element > *, OutputStateId, SubsetKey, SubsetEqual > | MinimalSubsetHash |
typedef std::unordered_map< const std::vector< Element > *, Element, SubsetKey, SubsetEqual > | InitialSubsetHash |
Private Member Functions | |
void | ConvertToMinimal (std::vector< Element > *subset) |
OutputStateId | MinimalToStateId (const std::vector< Element > &subset) |
OutputStateId | InitialToStateId (const std::vector< Element > &subset_in, Weight *remaining_weight, StringId *common_prefix) |
int | Compare (const Weight &a_w, StringId a_str, const Weight &b_w, StringId b_str) const |
void | EpsilonClosure (std::vector< Element > *subset) |
void | ProcessFinal (OutputStateId output_state) |
void | NormalizeSubset (std::vector< Element > *elems, Weight *tot_weight, StringId *common_str) |
void | MakeSubsetUnique (std::vector< Element > *subset) |
void | ProcessTransition (OutputStateId state, Label ilabel, std::vector< Element > *subset) |
void | ProcessTransitions (OutputStateId output_state) |
void | ProcessState (OutputStateId output_state) |
void | Debug () |
bool | IsIsymbolOrFinal (InputStateId state) |
void | InitializeDeterminization () |
KALDI_DISALLOW_COPY_AND_ASSIGN (LatticeDeterminizer) | |
Private Attributes | |
std::vector< std::vector< Element > *> | output_states_ |
std::vector< std::vector< TempArc > > | output_arcs_ |
int | num_arcs_ |
int | num_elems_ |
const Fst< Arc > * | ifst_ |
DeterminizeLatticeOptions | opts_ |
SubsetKey | hasher_ |
SubsetEqual | equal_ |
bool | determinized_ |
MinimalSubsetHash | minimal_hash_ |
InitialSubsetHash | initial_hash_ |
std::vector< OutputStateId > | queue_ |
std::vector< std::pair< Label, Element > > | all_elems_tmp_ |
std::vector< char > | isymbol_or_final_ |
LatticeStringRepository< IntType > | repository_ |
Definition at line 258 of file determinize-lattice-inl.h.
Definition at line 266 of file determinize-lattice-inl.h.
typedef ArcTpl<CompactWeight> CompactArc |
Definition at line 265 of file determinize-lattice-inl.h.
typedef CompactLatticeWeightTpl<Weight, IntType> CompactWeight |
Definition at line 264 of file determinize-lattice-inl.h.
|
private |
Definition at line 641 of file determinize-lattice-inl.h.
|
private |
Definition at line 532 of file determinize-lattice-inl.h.
|
private |
Definition at line 530 of file determinize-lattice-inl.h.
|
private |
Definition at line 633 of file determinize-lattice-inl.h.
|
private |
Definition at line 533 of file determinize-lattice-inl.h.
|
private |
Definition at line 531 of file determinize-lattice-inl.h.
|
private |
Definition at line 538 of file determinize-lattice-inl.h.
|
private |
Definition at line 537 of file determinize-lattice-inl.h.
|
private |
|
inline |
Definition at line 400 of file determinize-lattice-inl.h.
References KALDI_ASSERT.
|
inline |
Definition at line 431 of file determinize-lattice-inl.h.
|
inline |
Definition at line 468 of file determinize-lattice-inl.h.
References KALDI_VLOG, and KALDI_WARN.
|
inlineprivate |
Definition at line 733 of file determinize-lattice-inl.h.
References fst::Compare(), and LatticeStringRepository< IntType >::Entry::i.
|
inlineprivate |
Definition at line 647 of file determinize-lattice-inl.h.
|
inlineprivate |
Definition at line 1080 of file determinize-lattice-inl.h.
References LatticeStringRepository< IntType >::Entry::i, rnnlm::j, KALDI_ASSERT, KALDI_ERR, and KALDI_WARN.
Definition at line 498 of file determinize-lattice-inl.h.
References KALDI_WARN.
Referenced by fst::DeterminizeLattice().
|
inlineprivate |
Definition at line 762 of file determinize-lattice-inl.h.
References fst::Compare(), KALDI_ERR, LatticeDeterminizer< Weight, IntType >::Element::state, LatticeDeterminizer< Weight, IntType >::Element::string, fst::Times(), and LatticeDeterminizer< Weight, IntType >::Element::weight.
|
inline |
Definition at line 411 of file determinize-lattice-inl.h.
|
inlineprivate |
Definition at line 1169 of file determinize-lattice-inl.h.
References LatticeStringRepository< IntType >::KALDI_DISALLOW_COPY_AND_ASSIGN(), LatticeDeterminizer< Weight, IntType >::Element::state, LatticeDeterminizer< Weight, IntType >::Element::string, and LatticeDeterminizer< Weight, IntType >::Element::weight.
|
inlineprivate |
Definition at line 682 of file determinize-lattice-inl.h.
References KALDI_WARN, LatticeDeterminizer< Weight, IntType >::Element::state, LatticeDeterminizer< Weight, IntType >::Element::string, and LatticeDeterminizer< Weight, IntType >::Element::weight.
|
inlineprivate |
Definition at line 1143 of file determinize-lattice-inl.h.
|
private |
|
inlineprivate |
Definition at line 924 of file determinize-lattice-inl.h.
References fst::Compare().
|
inlineprivate |
Definition at line 664 of file determinize-lattice-inl.h.
|
inlineprivate |
Definition at line 891 of file determinize-lattice-inl.h.
References fst::Divide(), LatticeStringRepository< IntType >::Entry::i, KALDI_WARN, and fst::Plus().
|
inline |
Definition at line 272 of file determinize-lattice-inl.h.
References LatticeDeterminizer< Weight, IntType >::TempArc::ilabel, LatticeDeterminizer< Weight, IntType >::TempArc::nextstate, LatticeDeterminizer< Weight, IntType >::TempArc::string, kaldi::swap(), and LatticeDeterminizer< Weight, IntType >::TempArc::weight.
Referenced by fst::DeterminizeLattice().
Definition at line 318 of file determinize-lattice-inl.h.
References LatticeStringRepository< IntType >::Entry::i, LatticeDeterminizer< Weight, IntType >::TempArc::ilabel, LatticeDeterminizer< Weight, IntType >::TempArc::nextstate, LatticeDeterminizer< Weight, IntType >::TempArc::string, and LatticeDeterminizer< Weight, IntType >::TempArc::weight.
|
inlineprivate |
Definition at line 852 of file determinize-lattice-inl.h.
References fst::Compare(), LatticeDeterminizer< Weight, IntType >::TempArc::ilabel, LatticeDeterminizer< Weight, IntType >::TempArc::nextstate, LatticeDeterminizer< Weight, IntType >::Element::state, LatticeDeterminizer< Weight, IntType >::Element::string, LatticeDeterminizer< Weight, IntType >::TempArc::string, fst::Times(), LatticeDeterminizer< Weight, IntType >::Element::weight, and LatticeDeterminizer< Weight, IntType >::TempArc::weight.
|
inlineprivate |
Definition at line 1074 of file determinize-lattice-inl.h.
|
inlineprivate |
Definition at line 962 of file determinize-lattice-inl.h.
References LatticeDeterminizer< Weight, IntType >::TempArc::ilabel, LatticeDeterminizer< Weight, IntType >::TempArc::nextstate, LatticeDeterminizer< Weight, IntType >::TempArc::string, fst::Times(), and LatticeDeterminizer< Weight, IntType >::TempArc::weight.
|
inlineprivate |
Definition at line 1018 of file determinize-lattice-inl.h.
References LatticeDeterminizer< Weight, IntType >::Element::state, LatticeDeterminizer< Weight, IntType >::Element::string, fst::Times(), and LatticeDeterminizer< Weight, IntType >::Element::weight.
|
inline |
Definition at line 434 of file determinize-lattice-inl.h.
References LatticeStringRepository< IntType >::Entry::i, rnnlm::j, and LatticeDeterminizer< Weight, IntType >::Element::string.
Definition at line 1248 of file determinize-lattice-inl.h.
|
private |
Definition at line 1229 of file determinize-lattice-inl.h.
|
private |
Definition at line 1228 of file determinize-lattice-inl.h.
|
private |
Definition at line 1227 of file determinize-lattice-inl.h.
|
private |
Definition at line 1225 of file determinize-lattice-inl.h.
|
private |
Definition at line 1235 of file determinize-lattice-inl.h.
|
private |
Definition at line 1252 of file determinize-lattice-inl.h.
|
private |
Definition at line 1231 of file determinize-lattice-inl.h.
|
private |
Definition at line 1222 of file determinize-lattice-inl.h.
|
private |
Definition at line 1223 of file determinize-lattice-inl.h.
|
private |
Definition at line 1226 of file determinize-lattice-inl.h.
|
private |
Definition at line 1220 of file determinize-lattice-inl.h.
|
private |
Definition at line 1216 of file determinize-lattice-inl.h.
|
private |
Definition at line 1244 of file determinize-lattice-inl.h.
|
private |
Definition at line 1256 of file determinize-lattice-inl.h.