decodable-itf.h
Go to the documentation of this file.
1 // itf/decodable-itf.h
2 
3 // Copyright 2009-2011 Microsoft Corporation; Saarland University;
4 // Mirko Hannemann; Go Vivace Inc.;
5 // 2013 Johns Hopkins University (author: Daniel Povey)
6 
7 // See ../../COPYING for clarification regarding multiple authors
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
17 // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
18 // MERCHANTABLITY OR NON-INFRINGEMENT.
19 // See the Apache 2 License for the specific language governing permissions and
20 // limitations under the License.
21 
22 #ifndef KALDI_ITF_DECODABLE_ITF_H_
23 #define KALDI_ITF_DECODABLE_ITF_H_ 1
24 #include "base/kaldi-common.h"
25 
26 namespace kaldi {
29 
30 
83  public:
87  virtual BaseFloat LogLikelihood(int32 frame, int32 index) = 0;
88 
100  virtual bool IsLastFrame(int32 frame) const = 0;
101 
107  virtual int32 NumFramesReady() const {
108  KALDI_ERR << "NumFramesReady() not implemented for this decodable type.";
109  return -1;
110  }
111 
115  virtual int32 NumIndices() const = 0;
116 
117  virtual ~DecodableInterface() {}
118 };
120 } // namespace Kaldi
121 
122 #endif // KALDI_ITF_DECODABLE_ITF_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
virtual int32 NumFramesReady() const
The call NumFramesReady() will return the number of frames currently available for this decodable obj...
DecodableInterface provides a link between the (acoustic-modeling and feature-processing) code and th...
Definition: decodable-itf.h:82
virtual bool IsLastFrame(int32 frame) const =0
Returns true if this is the last frame.
kaldi::int32 int32
#define KALDI_ERR
Definition: kaldi-error.h:147
virtual int32 NumIndices() const =0
Returns the number of states in the acoustic model (they will be indexed one-based, i.e.
virtual BaseFloat LogLikelihood(int32 frame, int32 index)=0
Returns the log likelihood, which will be negated in the decoder.