44namespace LinguisticProcessing
46namespace MorphologicAnalysis
75 LERROR <<
"no param 'dictionary' in SimpleWord group for language " << (int) language;
80 m_dictionary = std::dynamic_pointer_cast<AbstractAnalysisDictionary>(res);
86 LDEBUG <<
"SimpleWord set confident mode to:" << confident;
88 m_confidentMode=(confident==
"true");
92 LWARN <<
"no param 'confidentMode' in SimpleWord group for language " << (int) language;
93 LWARN <<
"use default value : 'true'";
103 m_charChart = std::dynamic_pointer_cast<FlatTokenizer::CharChart>(res);
107 LERROR <<
"no param 'charChart' in SimpleWord group for language " << (int) language;
111 m_reader = std::make_shared<AlternativesReader>(m_confidentMode,
true,
true,
true, m_charChart,
117 m_parseConcatenated=(concat==
"true");
121 LWARN <<
"no param 'parseConcatenated' in SimpleWord group for language " << (int) language;
122 LWARN <<
"use default value : 'true'";
123 m_confidentMode=
true;
134 LINFO <<
"starting process SimpleWord";
136 auto tokenList=std::dynamic_pointer_cast<AnalysisGraph>(analysis.
getData(
"AnalysisGraph"));
143 boost::tie(it,itEnd)=vertices(*g);
144 for (;it!=itEnd;it++)
146 Token* currentToken=tokenMap[*it];
159 if (m_parseConcatenated)
173 accentedHandler = seh;
179 m_reader->readAlternatives(*currentToken,
191 clear_vertex(*it,*g);
194 if (accentedConcatHandler && !accentedConcatHandler->
getConcatVertices().empty())
199 clear_vertex(*it,*g);
202 if (m_parseConcatenated)
204 delete concatHandler;
205 delete accentedConcatHandler;
206 delete accentedHandler;
208 delete lingInfoHandler;
212 auto annotationData = std::dynamic_pointer_cast< AnnotationData >(analysis.
getData(
"AnnotationData"));
213 if (annotationData==0)
215 LINFO <<
"SimpleWord::process no annotation data, creating and populating it";
216 annotationData = std::make_shared<AnnotationData>();
217 analysis.
setData(
"AnnotationData", annotationData);
219 tokenList->populateAnnotationGraph(annotationData.get(),
"AnalysisGraph");
220 if (std::dynamic_pointer_cast<AnalysisGraph>(analysis.
getData(
"PosGraph")) != 0)
222 std::dynamic_pointer_cast<AnalysisGraph>(analysis.
getData(
"PosGraph"))->populateAnnotationGraph(
223 annotationData.get(),
228 LDEBUG <<
"ending process SimpleWord";
233void SimpleWord::linkConcatVertices(
236 const std::vector<std::vector<LinguisticGraphVertex> >& concats)
const
239 for (boost::tie(ieItr,ieItrEnd) = in_edges(srcToken,*graph);
245 for (boost::tie(oeItr,oeItrEnd) = out_edges(srcToken,*graph);
250 for (std::vector<std::vector<LinguisticGraphVertex> >::const_iterator concatItr=concats.begin();
251 concatItr!=concats.end();
254 add_edge(pred,concatItr->front(),*graph);
255 add_edge(concatItr->back(),next,*graph);
This file is the main header file for the data related to annotation graphs.
LinguisticGraph::in_edge_iterator LinguisticGraphInEdgeIt
boost::property_map< LinguisticGraph, vertex_data_t >::type VertexDataPropertyMap
LinguisticGraph::vertex_iterator LinguisticGraphVertexIt
boost::property_map< LinguisticGraph, vertex_token_t >::type VertexTokenPropertyMap
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
LinguisticGraph::out_edge_iterator LinguisticGraphOutEdgeIt
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.
#define SIMPLEWORD_CLASSID
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
void setData(const QString &id, std::shared_ptr< AnalysisData > data)
set an analysisData with the given id.
std::string & getParamsValueAtKey(const std::string &key)
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.
holds surface data of a token
uint64_t position() const
const TStatus & status() const
const LimaString & stringForm() const
StringsPoolIndex form() const
const std::vector< std::vector< LinguisticGraphVertex > > & getConcatVertices() const
const std::vector< std::vector< LinguisticGraphVertex > > & getConcatVertices() const
void addHandler(AbstractDictionaryEntryHandler *h)
void init(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
initialize with parameters from configuration file.
LimaStatusCode process(AnalysisContent &analysis) const override
Process on data in analysisContent.
static const LinguisticResources & 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 ...
SimpleFactory< MediaProcessUnit, SimpleWord > SimpleWordFactory(SIMPLEWORD_CLASSID)
launch exception related to the configuration file parsing