32namespace LinguisticProcessing
57 m_statusFile=os.str();
58 std::string outputFile;
65 outputFile=string(
"status.log");
67 m_out = std::unique_ptr< std::ofstream >(
new ofstream(outputFile.c_str(), std::ofstream::binary));
71 m_toLog.insert(tolog.begin(),tolog.end());
75 m_toLog.insert(
string(
"VmSize"));
91 auto metadata = std::dynamic_pointer_cast<LinguisticMetaData>(analysis.
getData(
"LinguisticMetaData"));
95 const string& filename=metadata->getMetaData(
"FileName");
96 *m_out << filename <<
" ";
101 string doc=metadata->getMetaData(
"DocumentName");
102 *m_out << doc <<
" ";
106 ifstream statusIn(m_statusFile.c_str(),ios::in | std::ifstream::binary);
108 while (statusIn.good())
111 size_t index=line.find(
":");
112 string key=line.substr(0,index);
113 if (m_toLog.find(key)!=m_toLog.end())
115 *m_out << line <<
" ";
120 *m_out <<
"TextSize= " << originalText->size() << endl;
Defines a Factory to create Object of type Base.
#define STATUSLOGGER_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
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.
define the limaStringText resource which is the text in limaString formal
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.
static uint64_t diffTime(const uint64_t &begin, const uint64_t &end)
return the difference between two times in microseconds
static void logElapsedTime(const std::string &mess, const std::string &taskCategory=std::string(""))
log the number of microseconds since last UpdateCurrentTime
static void updateCurrentTime(const std::string &taskCategory=std::string(""))
store current time for new elapsed time computation
static uint64_t getCurrentTime()
get the current time (real current time, not last time stored)
std::string readLine(std::istream &inputFile)
SimpleFactory< MediaProcessUnit, StatusLogger > statusLoggerFactory(STATUSLOGGER_CLASSID)
launch exception related to the configuration file parsing