phone-align-lattice.h
Go to the documentation of this file.
1 // lat/phone-align-lattice.h
2 
3 // Copyright 2009-2012 Microsoft Corporation Johns Hopkins University (Author: Daniel Povey)
4 
5 // See ../../COPYING for clarification regarding multiple authors
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15 // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16 // MERCHANTABLITY OR NON-INFRINGEMENT.
17 // See the Apache 2 License for the specific language governing permissions and
18 // limitations under the License.
19 
20 #ifndef KALDI_LAT_PHONE_ALIGN_LATTICE_H_
21 #define KALDI_LAT_PHONE_ALIGN_LATTICE_H_
22 #include <fst/fstlib.h>
23 #include <fst/fst-decl.h>
24 
25 #include "base/kaldi-common.h"
26 #include "util/common-utils.h"
27 #include "fstext/fstext-lib.h"
28 #include "hmm/transition-model.h"
29 #include "lat/kaldi-lattice.h"
30 
31 namespace kaldi {
32 
33 
35  bool reorder;
38  PhoneAlignLatticeOptions(): reorder(true),
39  remove_epsilon(true),
40  replace_output_symbols(false) { }
41  void Register(OptionsItf *opts) {
42  opts->Register("reorder", &reorder, "True if lattice was created from HCLG with "
43  "--reorder=true option.");
44  opts->Register("remove-epsilon", &remove_epsilon, "If true, removes epsilons from "
45  "the phone lattice; if replace-output-symbols==false, this will "
46  "mean that an arc can have multiple phones on it.");
47  opts->Register("replace-output-symbols", &replace_output_symbols, "If true, "
48  "the output symbols (typically words) will be replaced with "
49  "phones.");
50  }
51 };
52 
61 bool PhoneAlignLattice(const CompactLattice &lat,
62  const TransitionModel &tmodel,
63  const PhoneAlignLatticeOptions &opts,
64  CompactLattice *lat_out);
65 
66 
67 } // end namespace kaldi
68 #endif
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
fst::VectorFst< CompactLatticeArc > CompactLattice
Definition: kaldi-lattice.h:46
bool PhoneAlignLattice(const CompactLattice &lat, const TransitionModel &tmodel, const PhoneAlignLatticeOptions &opts, CompactLattice *lat_out)
Outputs a lattice in which the arcs correspond exactly to sequences of phones, so the boundaries betw...