104 auto metadata = std::dynamic_pointer_cast<LinguisticMetaData>(analysis.
getData(
"LinguisticMetaData"));
106 LERROR <<
"no LinguisticMetaData ! abort";
110 auto anaGraph = std::dynamic_pointer_cast<AnalysisGraph>(analysis.
getData(
"PosGraph"));
112 LERROR <<
"no AnalysisGraph ! abort";
116 auto sb = std::dynamic_pointer_cast<SegmentationData>(analysis.
getData(
"SentenceBoundaries"));
118 LDEBUG <<
"LinearTextRepresentationDumper::process: no SentenceBounds available: ignored";
122 boost::shared_ptr<LTR_Text> textRep(
new LTR_Text() );
125 *(anaGraph->getGraph()),
127 anaGraph->firstVertex(),
128 anaGraph->lastVertex(),
130 metadata->getStartOffset());
133 string textFileName = metadata->getMetaData(
"FileName");
134 string outputFile = textFileName + m_outputSuffix;
135 ofstream out(outputFile.c_str(), std::ofstream::binary);
137 throw runtime_error(
"can't open file " + outputFile);
139 textRep->binaryWriteOn(out);
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 LimaStatusCode process(AnalysisContent &analysis) const override
Process on data in analysisContent.
virtual void init(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
initialize with parameters from configuration file.
=========================================================================
#define LTRLOGGER_CLASSID