context-dep-itf.h
Go to the documentation of this file.
1 // itf/context-dep-itf.h
2 
3 // Copyright 2009-2011 Microsoft Corporation; Go Vivace Inc.
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 
21 #ifndef KALDI_ITF_CONTEXT_DEP_ITF_H_
22 #define KALDI_ITF_CONTEXT_DEP_ITF_H_
23 #include "base/kaldi-common.h"
24 
25 namespace kaldi {
28 
35  public:
38  virtual int ContextWidth() const = 0;
39 
42  virtual int CentralPosition() const = 0;
43 
60  virtual bool Compute(const std::vector<int32> &phoneseq, int32 pdf_class,
61  int32 *pdf_id) const = 0;
62 
69  virtual void GetPdfInfo(
70  const std::vector<int32> &phones, // list of phones
71  const std::vector<int32> &num_pdf_classes, // indexed by phone,
72  std::vector<std::vector<std::pair<int32, int32> > > *pdf_info)
73  const = 0;
74 
92  virtual void GetPdfInfo(
93  const std::vector<int32> &phones,
94  const std::vector<std::vector<std::pair<int32, int32> > > &pdf_class_pairs,
95  std::vector<std::vector<std::vector<std::pair<int32, int32> > > > *pdf_info)
96  const = 0;
97 
98 
100  virtual int32 NumPdfs() const = 0;
101 
104 
106  virtual ContextDependencyInterface *Copy() const = 0;
107  private:
109 };
111 } // namespace Kaldi
112 
113 
114 #endif
virtual void GetPdfInfo(const std::vector< int32 > &phones, const std::vector< int32 > &num_pdf_classes, std::vector< std::vector< std::pair< int32, int32 > > > *pdf_info) const =0
GetPdfInfo returns a vector indexed by pdf-id, saying for each pdf which pairs of (phone...
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
virtual bool Compute(const std::vector< int32 > &phoneseq, int32 pdf_class, int32 *pdf_id) const =0
The "new" Compute interface.
kaldi::int32 int32
virtual ContextDependencyInterface * Copy() const =0
Returns pointer to new object which is copy of current one.
virtual int CentralPosition() const =0
Central position P of the phone context, in 0-based numbering, e.g.
KALDI_DISALLOW_COPY_AND_ASSIGN(ContextDependencyInterface)
virtual int32 NumPdfs() const =0
NumPdfs() returns the number of acoustic pdfs (they are numbered 0.. NumPdfs()-1).
context-dep-itf.h provides a link between the tree-building code in ../tree/, and the FST code in ...
virtual int ContextWidth() const =0
ContextWidth() returns the value N (e.g.