105 auto metadata = std::dynamic_pointer_cast<LinguisticMetaData>(analysis.
getData(
"LinguisticMetaData"));
107 LERROR <<
"LinearTextRepresentationDumper::process: no LinguisticMetaData ! abort";
111 auto anaGraph = std::dynamic_pointer_cast<AnalysisGraph>(analysis.
getData(
"PosGraph"));
113 LERROR <<
"LinearTextRepresentationDumper::process: no AnalysisGraph ! abort";
117 auto sb = std::dynamic_pointer_cast<SegmentationData>(analysis.
getData(
"SentenceBoundaries"));
119 LDEBUG <<
"LinearTextRepresentationDumper::process: no SentenceBounds available: ignored";
123 boost::shared_ptr<LTR_Text> textRep(
new LTR_Text() );
126 *(anaGraph->getGraph()),
128 anaGraph->firstVertex(),
129 anaGraph->lastVertex(),
131 metadata->getStartOffset());
133 LDEBUG <<
"handler will be: " << m_handler;
135 auto h = std::dynamic_pointer_cast<AnalysisHandlerContainer>(analysis.
getData(
"AnalysisHandlerContainer"));
138 LERROR <<
"LinearTextRepresentationDumper::process: handler " << m_handler <<
" has not been given to the core client";
144 LDEBUG <<
"LinearTextRepresentationDumper::process result:" << *textRep;
145 textRep->binaryWriteOn(out);
defines callback interface
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
a linear text representation
build a LTRText with all the tokens from the analysis
void buildLTRTextFrom(const LinguisticGraph &graph, Lima::LinguisticProcessing::SegmentationData *sb, const LinguisticGraphVertex &graphFirstVertex, const LinguisticGraphVertex &graphLastVertex, boost::shared_ptr< Lima::Common::BagOfWords::LTR_Text > textRep, uint64_t offset)
build a LTRText representation of the analyzed text
virtual void init(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
initialize with parameters from configuration file.
virtual LimaStatusCode process(AnalysisContent &analysis) const override
Process on data in analysisContent.
=========================================================================
#define LTRDUMPER_CLASSID