tesseract  3.05.02
tesseract::CharClassifier Class Referenceabstract

#include <classifier_base.h>

Inheritance diagram for tesseract::CharClassifier:
tesseract::ConvNetCharClassifier tesseract::HybridNeuralNetCharClassifier

Public Member Functions

 CharClassifier (CharSet *char_set, TuningParams *params, FeatureBase *feat_extract)
 
virtual ~CharClassifier ()
 
virtual CharAltListClassify (CharSamp *char_samp)=0
 
virtual int CharCost (CharSamp *char_samp)=0
 
virtual bool Train (CharSamp *char_samp, int ClassID)=0
 
virtual bool SetLearnParam (char *var_name, float val)=0
 
virtual bool Init (const string &data_file_path, const string &lang, LangModel *lang_mod)=0
 
FeatureBaseFeatureExtractor ()
 
bool CaseSensitive () const
 
void SetCaseSensitive (bool case_sensitive)
 

Protected Member Functions

virtual void Fold ()=0
 
virtual bool LoadFoldingSets (const string &data_file_path, const string &lang, LangModel *lang_mod)=0
 

Protected Attributes

FeatureBasefeat_extract_
 
CharSetchar_set_
 
TuningParamsparams_
 
int ** fold_sets_
 
int * fold_set_len_
 
int fold_set_cnt_
 
bool init_
 
bool case_sensitive_
 

Detailed Description

Definition at line 35 of file classifier_base.h.

Constructor & Destructor Documentation

◆ CharClassifier()

tesseract::CharClassifier::CharClassifier ( CharSet char_set,
TuningParams params,
FeatureBase feat_extract 
)
inline

Definition at line 37 of file classifier_base.h.

38  {
39  char_set_ = char_set;
40  params_ = params;
41  feat_extract_ = feat_extract;
42  fold_sets_ = NULL;
43  fold_set_cnt_ = 0;
44  fold_set_len_ = NULL;
45  init_ = false;
46  case_sensitive_ = true;
47  }

◆ ~CharClassifier()

virtual tesseract::CharClassifier::~CharClassifier ( )
inlinevirtual

Definition at line 49 of file classifier_base.h.

49  {
50  if (fold_sets_ != NULL) {
51  for (int fold_set = 0; fold_set < fold_set_cnt_; fold_set++) {
52  delete []fold_sets_[fold_set];
53  }
54  delete []fold_sets_;
55  fold_sets_ = NULL;
56  }
57  delete []fold_set_len_;
58  fold_set_len_ = NULL;
59  delete feat_extract_;
60  feat_extract_ = NULL;
61  }

Member Function Documentation

◆ CaseSensitive()

bool tesseract::CharClassifier::CaseSensitive ( ) const
inline

Definition at line 73 of file classifier_base.h.

◆ CharCost()

virtual int tesseract::CharClassifier::CharCost ( CharSamp char_samp)
pure virtual

◆ Classify()

virtual CharAltList* tesseract::CharClassifier::Classify ( CharSamp char_samp)
pure virtual

◆ FeatureExtractor()

FeatureBase* tesseract::CharClassifier::FeatureExtractor ( )
inline

Definition at line 72 of file classifier_base.h.

72 {return feat_extract_;}

◆ Fold()

virtual void tesseract::CharClassifier::Fold ( )
protectedpure virtual

◆ Init()

virtual bool tesseract::CharClassifier::Init ( const string &  data_file_path,
const string &  lang,
LangModel lang_mod 
)
pure virtual

◆ LoadFoldingSets()

virtual bool tesseract::CharClassifier::LoadFoldingSets ( const string &  data_file_path,
const string &  lang,
LangModel lang_mod 
)
protectedpure virtual

◆ SetCaseSensitive()

void tesseract::CharClassifier::SetCaseSensitive ( bool  case_sensitive)
inline

Definition at line 74 of file classifier_base.h.

74  {
75  case_sensitive_ = case_sensitive;
76  }

◆ SetLearnParam()

virtual bool tesseract::CharClassifier::SetLearnParam ( char *  var_name,
float  val 
)
pure virtual

◆ Train()

virtual bool tesseract::CharClassifier::Train ( CharSamp char_samp,
int  ClassID 
)
pure virtual

Member Data Documentation

◆ case_sensitive_

bool tesseract::CharClassifier::case_sensitive_
protected

Definition at line 90 of file classifier_base.h.

◆ char_set_

CharSet* tesseract::CharClassifier::char_set_
protected

Definition at line 84 of file classifier_base.h.

◆ feat_extract_

FeatureBase* tesseract::CharClassifier::feat_extract_
protected

Definition at line 83 of file classifier_base.h.

◆ fold_set_cnt_

int tesseract::CharClassifier::fold_set_cnt_
protected

Definition at line 88 of file classifier_base.h.

◆ fold_set_len_

int* tesseract::CharClassifier::fold_set_len_
protected

Definition at line 87 of file classifier_base.h.

◆ fold_sets_

int** tesseract::CharClassifier::fold_sets_
protected

Definition at line 86 of file classifier_base.h.

◆ init_

bool tesseract::CharClassifier::init_
protected

Definition at line 89 of file classifier_base.h.

◆ params_

TuningParams* tesseract::CharClassifier::params_
protected

Definition at line 85 of file classifier_base.h.


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