Tesseract  3.02
tesseract::CubeRecoContext Class Reference

#include <cube_reco_context.h>

List of all members.

Public Types

enum  ReadOrder { L2R, R2L }

Public Member Functions

 CubeRecoContext (Tesseract *tess_obj)
 ~CubeRecoContext ()
const string & Lang () const
CharSetCharacterSet () const
const UNICHARSETTessUnicharset () const
CharClassifierClassifier () const
WordSizeModelSizeModel () const
CharBigramsBigrams () const
WordUnigramsWordUnigramsObj () const
TuningParamsParams () const
LangModelLangMod () const
ReadOrder ReadingOrder () const
bool HasCase () const
bool Cursive () const
bool HasItalics () const
bool Contextual () const
bool SizeNormalization () const
bool NoisyInput () const
bool OOD () const
bool Numeric () const
bool WordList () const
bool Punc () const
bool CaseSensitive () const
void SetSizeNormalization (bool size_normalization)
void SetNoisyInput (bool noisy_input)
void SetOOD (bool ood_enabled)
void SetNumeric (bool numeric_enabled)
void SetWordList (bool word_list_enabled)
void SetPunc (bool punc_enabled)
void SetCaseSensitive (bool case_sensitive)
tesseract::TesseractTesseractObject () const
bool GetDataFilePath (string *path) const

Static Public Member Functions

static CubeRecoContextCreate (Tesseract *tess_obj, TessdataManager *tessdata_manager, UNICHARSET *tess_unicharset)

Detailed Description

Definition at line 43 of file cube_reco_context.h.


Member Enumeration Documentation

Enumerator:
L2R 
R2L 

Definition at line 46 of file cube_reco_context.h.

                 {
   L2R,
   R2L
  };

Constructor & Destructor Documentation

tesseract::CubeRecoContext::CubeRecoContext ( Tesseract tess_obj)

Definition at line 40 of file cube_reco_context.cpp.

                                                    {
  tess_obj_ = tess_obj;
  lang_ = "";
  loaded_ = false;
  lang_mod_ = NULL;
  params_ = NULL;
  char_classifier_ = NULL;
  char_set_ = NULL;
  word_size_model_ = NULL;
  char_bigrams_ = NULL;
  word_unigrams_ = NULL;
  noisy_input_ = false;
  size_normalization_ = false;
}
tesseract::CubeRecoContext::~CubeRecoContext ( )

Definition at line 55 of file cube_reco_context.cpp.

                                  {
  if (char_classifier_ != NULL) {
    delete char_classifier_;
    char_classifier_ = NULL;
  }

  if (word_size_model_ != NULL) {
    delete word_size_model_;
    word_size_model_ = NULL;
  }

  if (char_set_ != NULL) {
    delete char_set_;
    char_set_ = NULL;
  }

  if (char_bigrams_ != NULL) {
    delete char_bigrams_;
    char_bigrams_ = NULL;
  }

  if (word_unigrams_ != NULL) {
    delete word_unigrams_;
    word_unigrams_ = NULL;
  }

  if (lang_mod_ != NULL) {
    delete lang_mod_;
    lang_mod_ = NULL;
  }

  if (params_ != NULL) {
    delete params_;
    params_ = NULL;
  }
}

Member Function Documentation

CharBigrams* tesseract::CubeRecoContext::Bigrams ( ) const [inline]

Definition at line 62 of file cube_reco_context.h.

{ return char_bigrams_; }
bool tesseract::CubeRecoContext::CaseSensitive ( ) const [inline]

Definition at line 96 of file cube_reco_context.h.

                                    {
    return char_classifier_->CaseSensitive();
  }
CharSet* tesseract::CubeRecoContext::CharacterSet ( ) const [inline]

Definition at line 58 of file cube_reco_context.h.

{ return char_set_; }
CharClassifier* tesseract::CubeRecoContext::Classifier ( ) const [inline]

Definition at line 60 of file cube_reco_context.h.

{ return char_classifier_; }
bool tesseract::CubeRecoContext::Contextual ( ) const [inline]

Definition at line 85 of file cube_reco_context.h.

                                 {
    return (lang_ == "ara");
  }
CubeRecoContext * tesseract::CubeRecoContext::Create ( Tesseract tess_obj,
TessdataManager tessdata_manager,
UNICHARSET tess_unicharset 
) [static]

Definition at line 182 of file cube_reco_context.cpp.

                                                                       {
  // create the object
  CubeRecoContext *cntxt = new CubeRecoContext(tess_obj);
  if (cntxt == NULL) {
    fprintf(stderr, "Cube ERROR (CubeRecoContext::Create): unable to create "
            "CubeRecoContext object\n");
    return NULL;
  }
  // load the necessary components
  if (cntxt->Load(tessdata_manager, tess_unicharset) == false) {
    fprintf(stderr, "Cube ERROR (CubeRecoContext::Create): unable to init "
            "CubeRecoContext object\n");
    delete cntxt;
    return NULL;
  }
  // success
  return cntxt;
}
bool tesseract::CubeRecoContext::Cursive ( ) const [inline]

Definition at line 77 of file cube_reco_context.h.

                              {
    return (lang_ == "ara");
  }
bool tesseract::CubeRecoContext::GetDataFilePath ( string *  path) const

Definition at line 94 of file cube_reco_context.cpp.

                                                        {
  *path = tess_obj_->datadir.string();
  return true;
}
bool tesseract::CubeRecoContext::HasCase ( ) const [inline]

Definition at line 73 of file cube_reco_context.h.

                              {
    return (lang_ != "ara" && lang_ != "hin");
  }
bool tesseract::CubeRecoContext::HasItalics ( ) const [inline]

Definition at line 81 of file cube_reco_context.h.

                                 {
    return (lang_ != "ara" && lang_ != "hin" && lang_ != "uk");
  }
const string& tesseract::CubeRecoContext::Lang ( ) const [inline]

Definition at line 57 of file cube_reco_context.h.

{ return lang_; }
LangModel* tesseract::CubeRecoContext::LangMod ( ) const [inline]

Definition at line 65 of file cube_reco_context.h.

{ return lang_mod_; }
bool tesseract::CubeRecoContext::NoisyInput ( ) const [inline]

Definition at line 91 of file cube_reco_context.h.

{ return noisy_input_; }
bool tesseract::CubeRecoContext::Numeric ( ) const [inline]

Definition at line 93 of file cube_reco_context.h.

{ return lang_mod_->Numeric(); }
bool tesseract::CubeRecoContext::OOD ( ) const [inline]

Definition at line 92 of file cube_reco_context.h.

{ return lang_mod_->OOD(); }
TuningParams* tesseract::CubeRecoContext::Params ( ) const [inline]

Definition at line 64 of file cube_reco_context.h.

{ return params_; }
bool tesseract::CubeRecoContext::Punc ( ) const [inline]

Definition at line 95 of file cube_reco_context.h.

{ return lang_mod_->Punc(); }
ReadOrder tesseract::CubeRecoContext::ReadingOrder ( ) const [inline]

Definition at line 68 of file cube_reco_context.h.

                                        {
    return ((lang_ == "ara") ? R2L : L2R);
  }
void tesseract::CubeRecoContext::SetCaseSensitive ( bool  case_sensitive) [inline]

Definition at line 118 of file cube_reco_context.h.

                                                    {
    char_classifier_->SetCaseSensitive(case_sensitive);
  }
void tesseract::CubeRecoContext::SetNoisyInput ( bool  noisy_input) [inline]

Definition at line 103 of file cube_reco_context.h.

                                              {
    noisy_input_ = noisy_input;
  }
void tesseract::CubeRecoContext::SetNumeric ( bool  numeric_enabled) [inline]

Definition at line 109 of file cube_reco_context.h.

                                               {
    lang_mod_->SetNumeric(numeric_enabled);
  }
void tesseract::CubeRecoContext::SetOOD ( bool  ood_enabled) [inline]

Definition at line 106 of file cube_reco_context.h.

                                       {
    lang_mod_->SetOOD(ood_enabled);
  }
void tesseract::CubeRecoContext::SetPunc ( bool  punc_enabled) [inline]

Definition at line 115 of file cube_reco_context.h.

                                         {
    lang_mod_->SetPunc(punc_enabled);
  }
void tesseract::CubeRecoContext::SetSizeNormalization ( bool  size_normalization) [inline]

Definition at line 100 of file cube_reco_context.h.

                                                            {
    size_normalization_ = size_normalization;
  }
void tesseract::CubeRecoContext::SetWordList ( bool  word_list_enabled) [inline]

Definition at line 112 of file cube_reco_context.h.

                                                  {
    lang_mod_->SetWordList(word_list_enabled);
  }
WordSizeModel* tesseract::CubeRecoContext::SizeModel ( ) const [inline]

Definition at line 61 of file cube_reco_context.h.

{ return word_size_model_; }
bool tesseract::CubeRecoContext::SizeNormalization ( ) const [inline]

Definition at line 90 of file cube_reco_context.h.

{ return size_normalization_; }
tesseract::Tesseract* tesseract::CubeRecoContext::TesseractObject ( ) const [inline]

Definition at line 121 of file cube_reco_context.h.

                                                     {
    return tess_obj_;
  }
const UNICHARSET* tesseract::CubeRecoContext::TessUnicharset ( ) const [inline]

Definition at line 59 of file cube_reco_context.h.

{ return tess_unicharset_; }
bool tesseract::CubeRecoContext::WordList ( ) const [inline]

Definition at line 94 of file cube_reco_context.h.

{ return lang_mod_->WordList(); }
WordUnigrams* tesseract::CubeRecoContext::WordUnigramsObj ( ) const [inline]

Definition at line 63 of file cube_reco_context.h.

{ return word_unigrams_; }

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