Tesseract  3.02
tesseract::CharClassifier Class Reference

#include <classifier_base.h>

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

List of all members.

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

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;
    }
  }

Member Function Documentation

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]
virtual CharAltList* tesseract::CharClassifier::Classify ( CharSamp char_samp) [pure virtual]
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]
virtual bool tesseract::CharClassifier::Train ( CharSamp char_samp,
int  ClassID 
) [pure virtual]

Member Data Documentation

Definition at line 96 of file classifier_base.h.

Definition at line 90 of file classifier_base.h.

Definition at line 94 of file classifier_base.h.

Definition at line 93 of file classifier_base.h.

Definition at line 92 of file classifier_base.h.

Definition at line 95 of file classifier_base.h.

Definition at line 91 of file classifier_base.h.


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