LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
posTaggingGraphWriter.cpp
Go to the documentation of this file.
1// Copyright 2002-2013 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
7#include "dotGraphWriter.h"
8
9#include <fstream>
11
12using namespace boost;
13using namespace std;
14
15namespace Lima
16{
17namespace LinguisticProcessing
18{
19namespace PosTagger
20{
21
22void PosTaggingGraphWriter::writeToDotFile(const std::string& dotFileName,deque<string> vertexDisplay)
23{
24 if (dotFileName != "")
25 {
27 m_graphDotOptions,
28 m_nodeDotOptions,
29 m_edgeDotOptions);
30
31 std::ofstream ofs(dotFileName.c_str(), std::ofstream::binary);
32 write_graphviz(
33 ofs,
34 *m_graph,
35 PosTaggingVertexWriter<LinguisticGraph,LinguisticGraphVertex>(m_graph, m_language, vertexDisplay),
36 PosTaggingEdgeWriter<LinguisticGraph,LinguisticGraphEdge>(m_language, m_graph, m_trigramMatrix, m_bigramMatrix),
37 graphWriter);
38 }
39
40}
41
42void PosTaggingGraphWriter::setOptions(const std::map<std::string,std::string>& graphDotOptions,
43 const std::map<std::string,std::string>& nodeDotOptions,
44 const std::map<std::string,std::string>& edgeDotOptions)
45{
46 m_graphDotOptions = graphDotOptions;
47 m_nodeDotOptions = nodeDotOptions;
48 m_edgeDotOptions = edgeDotOptions;
49}
50
51} // closing namespace PosTagger
52} // closing namespace LinguisticProcessing
53} // closing namespace Lima
void setOptions(const std::map< std::string, std::string > &graphDotOptions, const std::map< std::string, std::string > &nodeDotOptions, const std::map< std::string, std::string > &edgeDotOptions)
void writeToDotFile(const std::string &dotFileName, std::deque< std::string > vertexDisplay=std::deque< std::string >())
NAUTITIA.
STL namespace.