KwsTerm Class Reference

#include <kws-scoring.h>

Collaboration diagram for KwsTerm:

Public Member Functions

 KwsTerm ()
 
 KwsTerm (const std::string &kw_id, const std::vector< double > &vec)
 
bool valid () const
 
int utt_id () const
 
void set_utt_id (int utt_id)
 
std::string kw_id () const
 
void set_kw_id (const std::string &kw_id)
 
int start_time () const
 
void set_start_time (int start_time)
 
int end_time () const
 
void set_end_time (int end_time)
 
float score () const
 
void set_score (float score)
 

Private Attributes

int utt_id_
 
std::string kw_id_
 
int start_time_
 
int end_time_
 
float score_
 

Detailed Description

Definition at line 32 of file kws-scoring.h.

Constructor & Destructor Documentation

◆ KwsTerm() [1/2]

KwsTerm ( )
inline

Definition at line 34 of file kws-scoring.h.

34  :
35  utt_id_(0),
36  kw_id_(""),
37  start_time_(0),
38  end_time_(0),
39  score_(0)
40  { }
std::string kw_id_
Definition: kws-scoring.h:74

◆ KwsTerm() [2/2]

KwsTerm ( const std::string &  kw_id,
const std::vector< double > &  vec 
)
inline

Definition at line 45 of file kws-scoring.h.

References KALDI_ASSERT, KwsTerm::set_end_time(), KwsTerm::set_kw_id(), KwsTerm::set_score(), KwsTerm::set_start_time(), and KwsTerm::set_utt_id().

45  {
47 
48  KALDI_ASSERT(vec.size() == 4);
49 
50  set_utt_id(vec[0]);
51  set_start_time(vec[1]);
52  set_end_time(vec[2]);
53  set_score(vec[3]);
54  }
std::string kw_id() const
Definition: kws-scoring.h:63
void set_start_time(int start_time)
Definition: kws-scoring.h:66
void set_end_time(int end_time)
Definition: kws-scoring.h:68
void set_score(float score)
Definition: kws-scoring.h:70
void set_utt_id(int utt_id)
Definition: kws-scoring.h:62
void set_kw_id(const std::string &kw_id)
Definition: kws-scoring.h:64
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:185

Member Function Documentation

◆ end_time()

int end_time ( ) const
inline

◆ kw_id()

◆ score()

float score ( ) const
inline

Definition at line 69 of file kws-scoring.h.

References KwsTerm::score_.

Referenced by TwvMetrics::AddEvent(), and KwsTerm::set_score().

69 {return score_;}

◆ set_end_time()

void set_end_time ( int  end_time)
inline

Definition at line 68 of file kws-scoring.h.

References KwsTerm::end_time(), and KwsTerm::end_time_.

Referenced by KwsTerm::KwsTerm().

int end_time() const
Definition: kws-scoring.h:67

◆ set_kw_id()

void set_kw_id ( const std::string &  kw_id)
inline

Definition at line 64 of file kws-scoring.h.

References KwsTerm::kw_id(), and KwsTerm::kw_id_.

Referenced by KwsTerm::KwsTerm().

64 {kw_id_ = kw_id;}
std::string kw_id() const
Definition: kws-scoring.h:63
std::string kw_id_
Definition: kws-scoring.h:74

◆ set_score()

void set_score ( float  score)
inline

Definition at line 70 of file kws-scoring.h.

References KwsTerm::score(), and KwsTerm::score_.

Referenced by KwsTerm::KwsTerm().

70 {score_ = score;}
float score() const
Definition: kws-scoring.h:69

◆ set_start_time()

void set_start_time ( int  start_time)
inline

Definition at line 66 of file kws-scoring.h.

References KwsTerm::start_time(), and KwsTerm::start_time_.

Referenced by KwsTerm::KwsTerm().

int start_time() const
Definition: kws-scoring.h:65

◆ set_utt_id()

void set_utt_id ( int  utt_id)
inline

Definition at line 62 of file kws-scoring.h.

References KwsTerm::utt_id(), and KwsTerm::utt_id_.

Referenced by KwsTerm::KwsTerm().

62 {utt_id_ = utt_id;}
int utt_id() const
Definition: kws-scoring.h:61

◆ start_time()

int start_time ( ) const
inline

◆ utt_id()

◆ valid()

bool valid ( ) const
inline

Definition at line 56 of file kws-scoring.h.

References KwsTerm::kw_id_.

Referenced by TwvMetrics::AddEvent().

56  {
57  return (kw_id_ != "");
58  }
std::string kw_id_
Definition: kws-scoring.h:74

Member Data Documentation

◆ end_time_

int end_time_
private

Definition at line 76 of file kws-scoring.h.

Referenced by KwsTerm::end_time(), and KwsTerm::set_end_time().

◆ kw_id_

std::string kw_id_
private

Definition at line 74 of file kws-scoring.h.

Referenced by KwsTerm::kw_id(), KwsTerm::set_kw_id(), and KwsTerm::valid().

◆ score_

float score_
private

Definition at line 77 of file kws-scoring.h.

Referenced by KwsTerm::score(), and KwsTerm::set_score().

◆ start_time_

int start_time_
private

Definition at line 75 of file kws-scoring.h.

Referenced by KwsTerm::set_start_time(), and KwsTerm::start_time().

◆ utt_id_

int utt_id_
private

Definition at line 73 of file kws-scoring.h.

Referenced by KwsTerm::set_utt_id(), and KwsTerm::utt_id().


The documentation for this class was generated from the following file: