20 #ifndef KALDI_LAT_WORD_ALIGN_LATTICE_H_ 21 #define KALDI_LAT_WORD_ALIGN_LATTICE_H_ 22 #include <fst/fstlib.h> 23 #include <fst/fst-decl.h> 59 reorder(true), silence_may_be_word_internal(false),
60 silence_has_olabels(false) { }
63 opts->
Register(
"wbegin-phones", &wbegin_phones,
"Colon-separated list of " 64 "numeric ids of phones that begin a word");
65 opts->
Register(
"wend-phones", &wend_phones,
"Colon-separated list of " 66 "numeric ids of phones that end a word");
67 opts->
Register(
"winternal-phones", &winternal_phones,
"Colon-separated list " 68 "of numeric ids of phones that are internal to a word");
69 opts->
Register(
"wbegin-and-end-phones", &wbegin_and_end_phones,
"Colon-separated " 70 "list of numeric ids of phones that are used for " 71 "single-phone words.");
72 opts->
Register(
"silence-phones", &silence_phones,
"Colon-separated list of " 73 "numeric ids of phones that are used for silence (and other " 74 "non-word events such as noise - anything that doesn't have " 75 "a corresponding symbol in the lexicon.");
76 opts->
Register(
"silence-label", &silence_label,
"Numeric id of word symbol " 77 "that is to be used for silence arcs in the word-aligned " 78 "lattice (zero is OK)");
79 opts->
Register(
"partial-word-label", &partial_word_label,
"Numeric id of " 80 "word symbol that is to be used for arcs in the word-aligned " 81 "lattice corresponding to partial words at the end of " 82 "\"forced-out\" utterances (zero is OK)");
83 opts->
Register(
"reorder", &reorder,
"True if the lattices were generated " 84 "from graphs that had the --reorder option true, relating to " 85 "reordering self-loops (typically true)");
86 opts->
Register(
"silence-may-be-word-internal", &silence_may_be_word_internal,
87 "If true, silence may appear inside words' prons (but not at begin/end!)\n");
88 opts->
Register(
"silence-has-olabels", &silence_has_olabels,
89 "If true, silence phones have output labels in the lattice, just\n" 90 "like regular words. [This means you can't have un-labeled silences]");
105 opts->
Register(
"silence-label", &silence_label,
"Numeric id of word symbol " 106 "that is to be used for silence arcs in the word-aligned " 107 "lattice (zero is OK)");
108 opts->
Register(
"partial-word-label", &partial_word_label,
"Numeric id of " 109 "word symbol that is to be used for arcs in the word-aligned " 110 "lattice corresponding to partial words at the end of " 111 "\"forced-out\" utterances (zero is OK)");
112 opts->
Register(
"reorder", &reorder,
"True if the lattices were generated " 113 "from graphs that had the --reorder option true, relating to " 114 "reordering self-loops (typically true)");
132 std::string word_boundary_file);
134 void Init(std::istream &stream);
148 if ((p < 0 || p > phone_to_type.size()))
149 KALDI_ERR <<
"Phone " << p <<
" was not specified in " 150 "word-boundary file (or options)";
151 return phone_to_type[p];
168 void SetOptions(
const std::string int_list,
PhoneType phone_type);
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
std::vector< PhoneType > phone_to_type
std::string winternal_phones
bool WordAlignLattice(const CompactLattice &lat, const TransitionModel &tmodel, const WordBoundaryInfo &info, int32 max_states, CompactLattice *lat_out)
Align lattice so that each arc has the transition-ids on it that correspond to the word that is on th...
static bool TestWordAlignedLattice(const WordAlignLatticeLexiconInfo &lexicon_info, const TransitionModel &tmodel, CompactLattice clat, CompactLattice aligned_clat, bool allow_duplicate_paths)
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
std::string wbegin_phones
PhoneType TypeOfPhone(int32 p) const
void Register(OptionsItf *opts)
void Register(OptionsItf *opts)
std::string wbegin_and_end_phones
fst::VectorFst< CompactLatticeArc > CompactLattice
WordBoundaryInfoNewOpts()
bool silence_may_be_word_internal
std::string silence_phones