/***************************************************************************************** * Copyright (c) 2006 Hewlett-Packard Development Company, L.P. * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the * Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *****************************************************************************************/ /************************************************************************ * SVN MACROS * * $LastChangedDate$ * $Revision$ * $Author$ * ************************************************************************/ /************************************************************************ * FILE DESCR: Definition of LTKWordRecoConfig holds the config data for * the recognizer at the time of loading. * * CONTENTS: * getClassifierName * getDictionaryPath * getLipiRoot * getNumClasses * getProfile * getScript * getShapeSet * readConfigFile * setLipiRoot * * AUTHOR: Mudit Agrawal. * * DATE: Mar 2, 2005 * CHANGE HISTORY: * Author Date Description of change * Deepu 24-MAR-2005 Added getGrammarPath ************************************************************************/ #include "LTKWordRecoConfig.h" #include "LTKMacros.h" #include "LTKErrors.h" #include "LTKErrorsList.h" #include "LTKException.h" #include "LTKLoggerUtil.h" #include "LTKConfigFileReader.h" /********************************************************************************** * AUTHOR : Mudit Agrawal * DATE : 01-MAR-2005 * NAME : LTKWordRecoConfig * DESCRIPTION : DEFAULT CONSTRUCTOR * ARGUMENTS : * RETURNS : * NOTES : * CHANGE HISTROY * Author Date Description of change *************************************************************************************/ LTKWordRecoConfig::LTKWordRecoConfig() { LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) << " Entering: LTKWordRecoConfig::LTKWordRecoConfig()" << endl; m_lipiRoot = ""; m_problemName = ""; m_profile = ""; LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) << " Exiting: LTKWordRecoConfig::LTKWordRecoConfig()" << endl; } /********************************************************************************** * AUTHOR : Mudit Agrawal * DATE : 03-MAR-2005 * NAME : LTKWordRecoConfig * DESCRIPTION : Initialization Constructor * ARGUMENTS : lipiRoot * RETURNS : * NOTES : * CHANGE HISTROY * Author Date Description of change *************************************************************************************/ LTKWordRecoConfig::LTKWordRecoConfig(const string& lipiRoot) { LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) << " Entering: LTKWordRecoConfig::LTKWordRecoConfig(const string&)" << endl; if(lipiRoot=="") { LOG(LTKLogger::LTK_LOGLEVEL_ERR) <<"Error : "<< EEMPTY_STRING <<":"<< getErrorMessage(EEMPTY_STRING) <<" LTKWordRecoConfig::LTKWordRecoConfig(const string&)" <m_lipiRoot = lipiRoot; LOG(LTKLogger::LTK_LOGLEVEL_DEBUG) << "m_lipiRoot = " << m_lipiRoot <getConfigValue("script", m_script))!=SUCCESS) { LOG(LTKLogger::LTK_LOGLEVEL_ERR) <<"Error: LTKWordRecoConfig::readConfigFile()"<getConfigValue("problem", m_problemName))!=SUCCESS) { LOG(LTKLogger::LTK_LOGLEVEL_ERR) <<"Error: LTKWordRecoConfig::readConfigFile()"<getConfigValue("profile", m_profile))!=SUCCESS) { LOG(LTKLogger::LTK_LOGLEVEL_ERR) <<"Error: LTKWordRecoConfig::readConfigFile()"<getConfigValue("dictmap", m_dictionaryPath))!=SUCCESS) { LOG(LTKLogger::LTK_LOGLEVEL_ERR) <<"Error: LTKWordRecoConfig::readConfigFile()"<getConfigValue("grammarmap", m_grammarPath))!=SUCCESS) { LOG(LTKLogger::LTK_LOGLEVEL_ERR) <<"Error: LTKWordRecoConfig::readConfigFile()"<getConfigValue("classifier", m_classifierName))!=SUCCESS) { LOG(LTKLogger::LTK_LOGLEVEL_ERR) <<"Error: LTKWordRecoConfig::readConfigFile()"<