// fstext/context-fst.h // Copyright 2009-2011 Microsoft Corporation // See ../../COPYING for clarification regarding multiple authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, // MERCHANTABLITY OR NON-INFRINGEMENT. // See the Apache 2 License for the specific language governing permissions and // limitations under the License. // // This file includes material from the OpenFST Library v1.2.7 available at // http://www.openfst.org and released under the Apache License Version 2.0. // // See ../../COPYING for clarification regarding multiple authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Copyright 2005-2010 Google, Inc. // Author: riley@google.com (Michael Riley) #ifndef KALDI_FSTEXT_CONTEXT_FST_H_ #define KALDI_FSTEXT_CONTEXT_FST_H_ /* This header defines a context FST "C" which transduces from symbols representing phone context windows (e.g. "a, b, c") to individual phone, e.g. "a". The context FST is an on-demand FST. It has its own matcher type that makes it particularly efficient to compose with. */ #include #include #include #ifdef _MSC_VER #include #else #include #endif using std::tr1::unordered_map; #include #include #include #include "util/const-integer-set.h" namespace fst { /// \addtogroup context_fst_group "Classes and functions related to context expansion" /// @{ /* ContextFstImpl inherits from CacheImpl, which handles caching of states. */ template < class Arc, class LabelT = int32> // make the vector