doxygen ccmain/cube_reco_context.cpp

This commit is contained in:
Jim O'Regan 2015-07-20 12:58:15 +01:00
parent aa9a9711ad
commit c083ff243e

View File

@ -32,11 +32,13 @@
namespace tesseract { namespace tesseract {
/// Instantiate a CubeRecoContext object using a Tesseract object. /**
/// CubeRecoContext will not take ownership of tess_obj, but will * Instantiate a CubeRecoContext object using a Tesseract object.
/// record the pointer to it and will make use of various Tesseract * CubeRecoContext will not take ownership of tess_obj, but will
/// components (language model, flags, etc). Thus the caller should * record the pointer to it and will make use of various Tesseract
/// keep tess_obj alive so long as the instantiated CubeRecoContext is used. * components (language model, flags, etc). Thus the caller should
* keep tess_obj alive so long as the instantiated CubeRecoContext is used.
*/
CubeRecoContext::CubeRecoContext(Tesseract *tess_obj) { CubeRecoContext::CubeRecoContext(Tesseract *tess_obj) {
tess_obj_ = tess_obj; tess_obj_ = tess_obj;
lang_ = ""; lang_ = "";
@ -89,23 +91,27 @@ CubeRecoContext::~CubeRecoContext() {
} }
} }
/// Returns the path of the data files by looking up the TESSDATA_PREFIX /**
/// environment variable and appending a "tessdata" directory to it * Returns the path of the data files by looking up the TESSDATA_PREFIX
* environment variable and appending a "tessdata" directory to it
*/
bool CubeRecoContext::GetDataFilePath(string *path) const { bool CubeRecoContext::GetDataFilePath(string *path) const {
*path = tess_obj_->datadir.string(); *path = tess_obj_->datadir.string();
return true; return true;
} }
/// The object initialization function that loads all the necessary /**
/// components of a RecoContext. TessdataManager is used to load the * The object initialization function that loads all the necessary
/// data from [lang].traineddata file. If TESSDATA_CUBE_UNICHARSET * components of a RecoContext. TessdataManager is used to load the
/// component is present, Cube will be instantiated with the unicharset * data from [lang].traineddata file. If TESSDATA_CUBE_UNICHARSET
/// specified in this component and the corresponding dictionary * component is present, Cube will be instantiated with the unicharset
/// (TESSDATA_CUBE_SYSTEM_DAWG), and will map Cube's unicharset to * specified in this component and the corresponding dictionary
/// Tesseract's. Otherwise, TessdataManager will assume that Cube will * (TESSDATA_CUBE_SYSTEM_DAWG), and will map Cube's unicharset to
/// be using Tesseract's unicharset and dawgs, and will load the * Tesseract's. Otherwise, TessdataManager will assume that Cube will
/// unicharset from the TESSDATA_UNICHARSET component and will load the * be using Tesseract's unicharset and dawgs, and will load the
/// dawgs from TESSDATA_*_DAWG components. * unicharset from the TESSDATA_UNICHARSET component and will load the
* dawgs from TESSDATA_*_DAWG components.
*/
bool CubeRecoContext::Load(TessdataManager *tessdata_manager, bool CubeRecoContext::Load(TessdataManager *tessdata_manager,
UNICHARSET *tess_unicharset) { UNICHARSET *tess_unicharset) {
ASSERT_HOST(tess_obj_ != NULL); ASSERT_HOST(tess_obj_ != NULL);
@ -178,7 +184,7 @@ bool CubeRecoContext::Load(TessdataManager *tessdata_manager,
return true; return true;
} }
/// Creates a CubeRecoContext object using a tesseract object /** Creates a CubeRecoContext object using a tesseract object */
CubeRecoContext * CubeRecoContext::Create(Tesseract *tess_obj, CubeRecoContext * CubeRecoContext::Create(Tesseract *tess_obj,
TessdataManager *tessdata_manager, TessdataManager *tessdata_manager,
UNICHARSET *tess_unicharset) { UNICHARSET *tess_unicharset) {