37namespace LinguisticProcessing
39namespace LinguisticAnalysisStructure
63 m_graphId=string(
"AnalysisGraph");
75 auto metadata = std::dynamic_pointer_cast<LinguisticMetaData>(analysis.
getData(
"LinguisticMetaData"));
79 LERROR <<
"no LinguisticMetaData ! abort";
83 auto tokenList = std::dynamic_pointer_cast<AnalysisGraph>(analysis.
getData(m_graphId));
85 if (!
openLogFile(fout,metadata->getMetaData(
"FileName"))) {
87 LERROR <<
"Error: cannot open log file";
91 dump(fout, *tokenList);
101 std::ostream& m_ostream;
102 std::map<LinguisticGraphVertex,uint64_t> m_depthSource;
103 std::map<LinguisticGraphVertex,uint64_t> m_depth;
110 m_ostream(os),m_depthSource(),m_depth(),m_propertyCodeManager(pcm),m_stringsPool(stringsPool) {}
123 if (vsource == 0 && vtarget == 1) {
return; }
125 std::map<LinguisticGraphVertex,uint64_t>::iterator
126 d=m_depthSource.find(vsource);
127 if (d == m_depthSource.end())
129 m_depthSource[vsource]=0;
134 m_depthSource[vtarget]=(*d).second;
136 m_depth[vtarget]=(*d).second;
144 m_ostream <<
" <vertex id=\"" << v <<
"\">" << std::endl;
148 m_ostream <<
" <token>" << std::endl;
149 t->
outputXml(m_ostream,m_propertyCodeManager,m_stringsPool);
150 m_ostream <<
" </token>" << std::endl;
155 data->
outputXml(m_ostream,m_propertyCodeManager,m_stringsPool);
157 m_ostream <<
" </vertex>" << std::endl;
163void FullTokenXmlLogger::dump(std::ostream& xmlStream,
167 xmlStream <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
168 xmlStream <<
"<!--generated by MM project on ";
172 std::string str(ctime(&aclock));
174 xmlStream <<
"-->" << std::endl;
175 xmlStream <<
"<?xml-stylesheet type=\"text/xsl\" href=\"DataStructure.xslt\"?>" << std::endl;
176 xmlStream <<
"<data_structure xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
177 xmlStream <<
" xsi:noNamespaceSchemaLocation=\"DataStructure.xsd\">" << std::endl;
182 breadth_first_search(*(tTokenList.
getGraph()),
186 xmlStream <<
"</data_structure>" << std::endl;
AgglutinatedToken is a fulltoken that is a agglutinated compound word.
#define FULLTOKENXMLLOGGER_CLASSID
boost::graph_traits< LinguisticGraph >::edge_descriptor LinguisticGraphEdge
typedefs to simplify the access to various graphs elements
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
#define DICTIONARYLOGINIT
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
Provide tools to parse a property file, and deal with the property coding system.
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
A generic process unit to log information in files: contains some common informations such as : outpu...
bool openLogFile(std::ofstream &output, const std::string &sourceFile) const
virtual void init(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
initialize with parameters from configuration file.
An AnalysisData containing a LinguisticGraph with a language and an id.
const LinguisticGraph * getGraph(void) const
Returns the underlying graph structure.
const LinguisticGraphVertex & firstVertex(void) const
Returns the first vertex of the graph.
DumpXMLVisitor(std::ostream &os, const Common::PropertyCode::PropertyCodeManager &pcm, const FsaStringsPool &stringsPool)
void discover_vertex(LinguisticGraphVertex v, const LinguisticGraph &g)
void examine_edge(LinguisticGraphEdge v, const LinguisticGraph &g)
LimaStatusCode process(AnalysisContent &analysis) const override
Process on data in analysisContent.
void init(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
initialize with parameters from configuration file.
virtual ~FullTokenXmlLogger()
Holds morphosyntactic informations.
void outputXml(std::ostream &xmlStream, const Common::PropertyCode::PropertyCodeManager &pcm, const FsaStringsPool &sp) const
holds surface data of a token
virtual void outputXml(std::ostream &xmlStream, const Common::PropertyCode::PropertyCodeManager &pcm, const FsaStringsPool &sp) const
static const MediaticData & single()
const singleton accessor
SimpleFactory< MediaProcessUnit, FullTokenXmlLogger > fullTokenXmlLoggerFactory(FULLTOKENXMLLOGGER_CLASSID)
launch exception related to the configuration file parsing