diff --git a/egs/mini_librispeech/s5/local/grammar/extend_vocab_demo.sh b/egs/mini_librispeech/s5/local/grammar/extend_vocab_demo.sh index 382f9f4f6c6..1ec4a0d575b 100755 --- a/egs/mini_librispeech/s5/local/grammar/extend_vocab_demo.sh +++ b/egs/mini_librispeech/s5/local/grammar/extend_vocab_demo.sh @@ -96,7 +96,7 @@ if [ $stage -le 4 ]; then if $run_g2p; then steps/dict/apply_g2p.sh $tree_dir/extvocab_nosp_lexicon/words $tree_dir/extvocab_nosp_g2p $tree_dir/extvocab_nosp_lexicon else - cat <$tree_dir/extvocab_nosp_lexicon//lexicon.lex + cat <$tree_dir/extvocab_nosp_lexicon/lexicon.lex HARDWIGG 0.962436 HH AA1 R D W IH1 G SUDVESTR 0.162048 S AH1 D V EY1 S T R SUDVESTR 0.133349 S AH1 D V EH1 S T R diff --git a/src/base/io-funcs.h b/src/base/io-funcs.h index ca476033950..6c2b690f54c 100644 --- a/src/base/io-funcs.h +++ b/src/base/io-funcs.h @@ -31,7 +31,9 @@ #include #include #include + #include "base/kaldi-common.h" +#include "base/io-funcs-inl.h" namespace kaldi { @@ -235,7 +237,4 @@ inline void InitKaldiOutputStream(std::ostream &os, bool binary); inline bool InitKaldiInputStream(std::istream &is, bool *binary); } // end namespace kaldi. - -#include "base/io-funcs-inl.h" - #endif // KALDI_BASE_IO_FUNCS_H_ diff --git a/src/bin/draw-tree.cc b/src/bin/draw-tree.cc index ad1dd41a53f..c9be5586933 100644 --- a/src/bin/draw-tree.cc +++ b/src/bin/draw-tree.cc @@ -18,6 +18,7 @@ // limitations under the License. #include "tree/tree-renderer.h" +#include "tree/context-dep.h" void MakeEvent(std::string &qry, fst::SymbolTable *phone_syms, kaldi::EventType **query) diff --git a/src/chainbin/chain-get-supervision.cc b/src/chainbin/chain-get-supervision.cc index 6090d9f0058..1ac89d4630b 100644 --- a/src/chainbin/chain-get-supervision.cc +++ b/src/chainbin/chain-get-supervision.cc @@ -22,6 +22,7 @@ #include "base/kaldi-common.h" #include "util/common-utils.h" #include "chain/chain-supervision.h" +#include "tree/context-dep.h" namespace kaldi { namespace chain { diff --git a/src/decoder/decodable-matrix.h b/src/decoder/decodable-matrix.h index f32a007e6ca..475638a35af 100644 --- a/src/decoder/decodable-matrix.h +++ b/src/decoder/decodable-matrix.h @@ -26,6 +26,7 @@ #include "base/kaldi-common.h" #include "hmm/transition-model.h" #include "itf/decodable-itf.h" +#include "matrix/kaldi-matrix.h" namespace kaldi { @@ -241,8 +242,6 @@ class DecodableMatrixScaled: public DecodableInterface { BaseFloat scale_; KALDI_DISALLOW_COPY_AND_ASSIGN(DecodableMatrixScaled); }; - - } // namespace kaldi #endif // KALDI_DECODER_DECODABLE_MATRIX_H_ diff --git a/src/decoder/lattice-faster-online-decoder.h b/src/decoder/lattice-faster-online-decoder.h index e56f24a2474..69bf8b6d98d 100644 --- a/src/decoder/lattice-faster-online-decoder.h +++ b/src/decoder/lattice-faster-online-decoder.h @@ -90,7 +90,7 @@ class LatticeFasterOnlineDecoderTpl: /// Outputs an FST corresponding to the single best path through the lattice. /// This is quite efficient because it doesn't get the entire raw lattice and find - /// the best path through it; insterad, it uses the BestPathEnd and BestPathIterator + /// the best path through it; instead, it uses the BestPathEnd and BestPathIterator /// so it basically traces it back through the lattice. /// Returns true if result is nonempty (using the return status is deprecated, /// it will become void). If "use_final_probs" is true AND we reached the diff --git a/src/decoder/training-graph-compiler.h b/src/decoder/training-graph-compiler.h index 77c5735687f..ee56c6dfb3d 100644 --- a/src/decoder/training-graph-compiler.h +++ b/src/decoder/training-graph-compiler.h @@ -24,6 +24,7 @@ #include "hmm/transition-model.h" #include "fst/fstlib.h" #include "fstext/fstext-lib.h" +#include "tree/context-dep.h" namespace kaldi { diff --git a/src/doc/grammar.dox b/src/doc/grammar.dox index 80000c0b067..d1c6f51f349 100644 --- a/src/doc/grammar.dox +++ b/src/doc/grammar.dox @@ -336,7 +336,7 @@ Z_S 243 that consume CLG.fst always also consume the ilabel_info, which is a vector >. For a particular ilabel, say 1536, ilabel_info[1536] = { 5, 21 } is a vector of integers representing a phone-in-context. E.g. this would represent the phone 21 with a left-context of 5. - Disambiguation symbols also appear on the input of CLG.fst, and they are are represented in the ilabel_info + Disambiguation symbols also appear on the input of CLG.fst, and they are represented in the ilabel_info a 1-dimensional vector like { -104 } containing the negative of the disambiguation symbol's integer id. @@ -352,7 +352,7 @@ Z_S 243 The special symbols in CLG.fst will be as follows. The following special symbols may appear in any CLG graph, top-level or not: - - When any graph invokes a sub-graph, there will ben arc with an ilabel + - When any graph invokes a sub-graph, there will be n arc with an ilabel (\#nonterm:foo, left-context-phone) representing the user-specified nonterminal and the actual left-context, which will be followed by arcs with ilabels of the form (\#nonterm_reenter, diff --git a/src/gmmbin/gmm-init-biphone.cc b/src/gmmbin/gmm-init-biphone.cc index e5cc182f94c..42a9d1a91a0 100644 --- a/src/gmmbin/gmm-init-biphone.cc +++ b/src/gmmbin/gmm-init-biphone.cc @@ -22,6 +22,7 @@ #include "util/common-utils.h" #include "gmm/am-diag-gmm.h" #include "tree/event-map.h" +#include "tree/context-dep.h" #include "hmm/hmm-topology.h" #include "hmm/transition-model.h" diff --git a/src/gmmbin/gmm-init-mono.cc b/src/gmmbin/gmm-init-mono.cc index 0aac769eb70..3c370c36515 100644 --- a/src/gmmbin/gmm-init-mono.cc +++ b/src/gmmbin/gmm-init-mono.cc @@ -23,6 +23,7 @@ #include "gmm/am-diag-gmm.h" #include "hmm/hmm-topology.h" #include "hmm/transition-model.h" +#include "tree/context-dep.h" namespace kaldi { // This function reads a file like: diff --git a/src/hmm/hmm-test-utils.h b/src/hmm/hmm-test-utils.h index 495ebf278ae..4faaa92fa66 100644 --- a/src/hmm/hmm-test-utils.h +++ b/src/hmm/hmm-test-utils.h @@ -24,6 +24,7 @@ #include "hmm/hmm-topology.h" #include "hmm/transition-model.h" #include "lat/kaldi-lattice.h" +#include "tree/context-dep.h" namespace kaldi { diff --git a/src/hmm/hmm-topology.h b/src/hmm/hmm-topology.h index edea02998c0..750d35bcfe4 100644 --- a/src/hmm/hmm-topology.h +++ b/src/hmm/hmm-topology.h @@ -21,7 +21,6 @@ #define KALDI_HMM_HMM_TOPOLOGY_H_ #include "base/kaldi-common.h" -#include "tree/context-dep.h" #include "util/const-integer-set.h" diff --git a/src/hmm/posterior.h b/src/hmm/posterior.h index 0c255845dd5..e153c249740 100644 --- a/src/hmm/posterior.h +++ b/src/hmm/posterior.h @@ -24,7 +24,6 @@ #define KALDI_HMM_POSTERIOR_H_ #include "base/kaldi-common.h" -#include "tree/context-dep.h" #include "util/const-integer-set.h" #include "util/kaldi-table.h" #include "hmm/transition-model.h" diff --git a/src/hmm/transition-model.h b/src/hmm/transition-model.h index f03b54e8b71..e453c24f9cb 100644 --- a/src/hmm/transition-model.h +++ b/src/hmm/transition-model.h @@ -22,11 +22,12 @@ #define KALDI_HMM_TRANSITION_MODEL_H_ #include "base/kaldi-common.h" -#include "tree/context-dep.h" #include "util/const-integer-set.h" #include "fst/fst-decl.h" // forward declarations. #include "hmm/hmm-topology.h" #include "itf/options-itf.h" +#include "itf/context-dep-itf.h" +#include "matrix/kaldi-vector.h" namespace kaldi { diff --git a/src/lat/minimize-lattice.h b/src/lat/minimize-lattice.h index fcf6c0f36df..eb13fc1c851 100644 --- a/src/lat/minimize-lattice.h +++ b/src/lat/minimize-lattice.h @@ -28,7 +28,6 @@ #include "base/kaldi-common.h" #include "util/common-utils.h" #include "fstext/fstext-lib.h" -#include "hmm/transition-model.h" #include "lat/kaldi-lattice.h" namespace fst { diff --git a/src/lat/push-lattice.h b/src/lat/push-lattice.h index e782aadc0f3..080bb637604 100644 --- a/src/lat/push-lattice.h +++ b/src/lat/push-lattice.h @@ -28,7 +28,6 @@ #include "base/kaldi-common.h" #include "util/common-utils.h" #include "fstext/fstext-lib.h" -#include "hmm/transition-model.h" #include "lat/kaldi-lattice.h" namespace fst { diff --git a/src/matrix/kaldi-blas.h b/src/matrix/kaldi-blas.h index 5d25ab852bd..8a06540bba2 100644 --- a/src/matrix/kaldi-blas.h +++ b/src/matrix/kaldi-blas.h @@ -50,8 +50,8 @@ #ifdef HAVE_ATLAS extern "C" { - #include - #include + #include "cblas.h" + #include "clapack.h" } #elif defined(HAVE_CLAPACK) #ifdef __APPLE__ @@ -74,7 +74,7 @@ // from the tools/CLAPACK_include directory. #include #include - #include + #include // get rid of macros from f2c.h -- these are dangerous. #undef abs @@ -110,7 +110,7 @@ #undef bit_clear #undef bit_set #else - #error "You need to define (using the preprocessor) either HAVE_CLAPACK or HAVE_ATLAS or HAVE_MKL (but not more than one)" + #error "You need to define (using the preprocessor) either HAVE_CLAPACK or HAVE_ATLAS or HAVE_MKL (but not more than one)" #endif #ifdef HAVE_OPENBLAS diff --git a/src/online2/online-gmm-decodable.h b/src/online2/online-gmm-decodable.h index c037ad0efe4..1a1d37ba2a2 100644 --- a/src/online2/online-gmm-decodable.h +++ b/src/online2/online-gmm-decodable.h @@ -24,8 +24,10 @@ #define KALDI_ONLINE2_ONLINE_GMM_DECODABLE_H_ #include "itf/online-feature-itf.h" -#include "gmm/decodable-am-diag-gmm.h" #include "matrix/matrix-lib.h" +#include "itf/decodable-itf.h" +#include "gmm/am-diag-gmm.h" +#include "hmm/transition-model.h" namespace kaldi { @@ -37,20 +39,20 @@ class DecodableDiagGmmScaledOnline : public DecodableInterface { const BaseFloat scale, OnlineFeatureInterface *input_feats); - + /// Returns the scaled log likelihood virtual BaseFloat LogLikelihood(int32 frame, int32 index); - + virtual bool IsLastFrame(int32 frame) const; - virtual int32 NumFramesReady() const; - + virtual int32 NumFramesReady() const; + /// Indices are one-based! This is for compatibility with OpenFst. virtual int32 NumIndices() const { return trans_model_.NumTransitionIds(); } private: void CacheFrame(int32 frame); - + OnlineFeatureInterface *features_; const AmDiagGmm &ac_model_; BaseFloat ac_scale_; diff --git a/src/online2/online-speex-wrapper.cc b/src/online2/online-speex-wrapper.cc index 0af5bd90bd0..e41a812ca32 100644 --- a/src/online2/online-speex-wrapper.cc +++ b/src/online2/online-speex-wrapper.cc @@ -18,7 +18,7 @@ // limitations under the License. #include -#include "online-speex-wrapper.h" +#include "online2/online-speex-wrapper.h" namespace kaldi { diff --git a/src/online2/onlinebin-util.cc b/src/online2/onlinebin-util.cc index 74c594eeb79..f143ebbc5f7 100644 --- a/src/online2/onlinebin-util.cc +++ b/src/online2/onlinebin-util.cc @@ -20,7 +20,7 @@ // See the Apache 2 License for the specific language governing permissions and // limitations under the License. -#include "onlinebin-util.h" +#include "online2/onlinebin-util.h" namespace kaldi { diff --git a/src/tree/tree-renderer.cc b/src/tree/tree-renderer.cc index cbc2ce05677..bbaa5cda162 100644 --- a/src/tree/tree-renderer.cc +++ b/src/tree/tree-renderer.cc @@ -19,6 +19,8 @@ #include "tree/tree-renderer.h" +#include "tree/context-dep.h" + namespace kaldi { const int32 TreeRenderer::kEdgeWidth = 1; const int32 TreeRenderer::kEdgeWidthQuery = 3; diff --git a/src/tree/tree-renderer.h b/src/tree/tree-renderer.h index 5e0b0d89198..78f4b9aa403 100644 --- a/src/tree/tree-renderer.h +++ b/src/tree/tree-renderer.h @@ -23,7 +23,6 @@ #include "base/kaldi-common.h" #include "tree/event-map.h" #include "util/common-utils.h" -#include "hmm/transition-model.h" #include "fst/fstlib.h" namespace kaldi {