Tesseract
3.02
|
#include <classifier_base.h>
Public Member Functions | |
CharClassifier (CharSet *char_set, TuningParams *params, FeatureBase *feat_extract) | |
virtual | ~CharClassifier () |
virtual CharAltList * | Classify (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 |
FeatureBase * | FeatureExtractor () |
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 | |
FeatureBase * | feat_extract_ |
CharSet * | char_set_ |
TuningParams * | params_ |
int ** | fold_sets_ |
int * | fold_set_len_ |
int | fold_set_cnt_ |
bool | init_ |
bool | case_sensitive_ |
Definition at line 35 of file classifier_base.h.
tesseract::CharClassifier::CharClassifier | ( | CharSet * | char_set, |
TuningParams * | params, | ||
FeatureBase * | feat_extract | ||
) | [inline] |
Definition at line 37 of file classifier_base.h.
{ char_set_ = char_set; params_ = params; feat_extract_ = feat_extract; fold_sets_ = NULL; fold_set_cnt_ = 0; fold_set_len_ = NULL; init_ = false; case_sensitive_ = true; }
virtual tesseract::CharClassifier::~CharClassifier | ( | ) | [inline, virtual] |
Definition at line 49 of file classifier_base.h.
{ if (fold_sets_ != NULL) { for (int fold_set = 0; fold_set < fold_set_cnt_; fold_set++) { if (fold_sets_[fold_set] != NULL) { delete []fold_sets_[fold_set]; } } delete []fold_sets_; fold_sets_ = NULL; } if (fold_set_len_ != NULL) { delete []fold_set_len_; fold_set_len_ = NULL; } if (feat_extract_ != NULL) { delete feat_extract_; feat_extract_ = NULL; } }
bool tesseract::CharClassifier::CaseSensitive | ( | ) | const [inline] |
Definition at line 79 of file classifier_base.h.
{ return case_sensitive_; }
virtual int tesseract::CharClassifier::CharCost | ( | CharSamp * | char_samp | ) | [pure virtual] |
Implemented in tesseract::ConvNetCharClassifier, and tesseract::HybridNeuralNetCharClassifier.
virtual CharAltList* tesseract::CharClassifier::Classify | ( | CharSamp * | char_samp | ) | [pure virtual] |
Implemented in tesseract::ConvNetCharClassifier, and tesseract::HybridNeuralNetCharClassifier.
FeatureBase* tesseract::CharClassifier::FeatureExtractor | ( | ) | [inline] |
Definition at line 78 of file classifier_base.h.
{return feat_extract_;}
virtual void tesseract::CharClassifier::Fold | ( | ) | [protected, pure virtual] |
virtual bool tesseract::CharClassifier::Init | ( | const string & | data_file_path, |
const string & | lang, | ||
LangModel * | lang_mod | ||
) | [pure virtual] |
virtual bool tesseract::CharClassifier::LoadFoldingSets | ( | const string & | data_file_path, |
const string & | lang, | ||
LangModel * | lang_mod | ||
) | [protected, pure virtual] |
void tesseract::CharClassifier::SetCaseSensitive | ( | bool | case_sensitive | ) | [inline] |
Definition at line 80 of file classifier_base.h.
{ case_sensitive_ = case_sensitive; }
virtual bool tesseract::CharClassifier::SetLearnParam | ( | char * | var_name, |
float | val | ||
) | [pure virtual] |
Implemented in tesseract::ConvNetCharClassifier, and tesseract::HybridNeuralNetCharClassifier.
virtual bool tesseract::CharClassifier::Train | ( | CharSamp * | char_samp, |
int | ClassID | ||
) | [pure virtual] |
Implemented in tesseract::ConvNetCharClassifier, and tesseract::HybridNeuralNetCharClassifier.
bool tesseract::CharClassifier::case_sensitive_ [protected] |
Definition at line 96 of file classifier_base.h.
CharSet* tesseract::CharClassifier::char_set_ [protected] |
Definition at line 90 of file classifier_base.h.
FeatureBase* tesseract::CharClassifier::feat_extract_ [protected] |
Definition at line 89 of file classifier_base.h.
int tesseract::CharClassifier::fold_set_cnt_ [protected] |
Definition at line 94 of file classifier_base.h.
int* tesseract::CharClassifier::fold_set_len_ [protected] |
Definition at line 93 of file classifier_base.h.
int** tesseract::CharClassifier::fold_sets_ [protected] |
Definition at line 92 of file classifier_base.h.
bool tesseract::CharClassifier::init_ [protected] |
Definition at line 95 of file classifier_base.h.
TuningParams* tesseract::CharClassifier::params_ [protected] |
Definition at line 91 of file classifier_base.h.