41namespace LinguisticProcessing
43namespace MorphologicAnalysis
60 std::deque<std::string> skipUnmarkStatus;
64 readDefaultsFromFile(file.toUtf8().constData());
68 LERROR <<
"no param 'defaultPropertyFile' in DefaultProperties group for language " << (int) m_language;
75 m_charChart = std::dynamic_pointer_cast< FlatTokenizer::CharChart >(res);
79 LERROR <<
"no param 'charChart' in DefaultProperties group for language " << (int) m_language;
92 for( std::deque<std::string>::iterator src = skipUnmarkStatus.begin() ; src != skipUnmarkStatus.end() ; src++ )
110 auto tokenList=std::dynamic_pointer_cast<AnalysisGraph>(analysis.
getData(
"AnalysisGraph"));
116 boost::tie(v, vEnd) = vertices(*g);
118 for (; v != vEnd; v++)
121 if (currentData == 0)
130 if (currentData->empty())
132 std::map<LimaString,std::vector<LinguisticCode> >::const_iterator it=m_defaults.find(currentToken->
status().
defaultKey());
133 if (it!=m_defaults.end())
138 if(m_skipUnmarkStatus.find(currentToken->
status().
defaultKey())==m_skipUnmarkStatus.end())
141 if (! unmarked.isEmpty())
150 for (std::vector<LinguisticCode>::const_iterator codeItr=it->second.begin();
151 codeItr!=it->second.end();
155 currentData->push_back(elem);
160 LWARN <<
"No default property for "
167 catch (std::exception &exc)
170 LWARN <<
"Exception in Default Properties : " << exc.what();
177void DefaultProperties::readDefaultsFromFile(
const std::string& filename)
180 LINFO <<
"read default properties from file : " << filename;
181 ifstream fin(filename.c_str(), std::ifstream::binary);
185 while (fin.good() && !fin.eof())
190 istringstream is(line);
194 LDEBUG <<
"read default " << type <<
" => " << props;
#define DEFAULTPROPERTIES_CLASSID
#define LIMA_EXCEPTION(X)
This macro writes the message X to a previously configured error stream before throwing a LimaExcepti...
LinguisticGraph::vertex_iterator LinguisticGraphVertexIt
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
Defines a Factory to create Object of type Base.
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
std::shared_ptr< AnalysisData > getData(const QString &id)
return AnalysisData by id
std::string & getParamsValueAtKey(const std::string &key)
std::deque< std::string > & getListsValueAtKey(const std::string &key)
return a message when a 'list' was not found
return a message when a 'param' was not found
Manage initialization of InitializableObjects using configuration module and parameters.
const InitializationParameters & getInitializationParameters() const
get Initialization Parameters
Use this exception to signal an error in one of the configuration files.
Holds morphosyntactic informations.
const Lima::LimaString & defaultKey() const
holds surface data of a token
const TStatus & status() const
const LimaString & stringForm() const
StringsPoolIndex form() const
virtual ~DefaultProperties()
LimaStatusCode process(AnalysisContent &analysis) const override
Each token of the specified path without dictionnary entry is searched into the specified dictionary.
void init(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
initialize with parameters from configuration file.
static const MediaticData & single()
const singleton accessor
static MediaticData & changeable()
singleton accessor
This file contains a class to control log of informations about time, such as logging cumulated time ...
std::string readLine(std::istream &inputFile)
std::string limastring2utf8stdstring(const Lima::LimaString &phrase, uint32_t size0)
Convert a wide string to a string , in dest up to size bytes.
QString findFileInPaths(const QString &paths, const QString &fileName, const QChar &separator)
Find the given file in the given paths.
LimaString utf8stdstring2limastring(const std::string &src)
SimpleFactory< MediaProcessUnit, DefaultProperties > defaultPropertiesFactory(DEFAULTPROPERTIES_CLASSID)
StringsPoolIndex inflectedForm
StringsPoolIndex normalizedForm
LinguisticCode properties