LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
LTRTextBuilder.h
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
21#ifndef LIMA_LINGUISTICPROCESSING_LTRTEXTBUILDER_H
22#define LIMA_LINGUISTICPROCESSING_LTRTEXTBUILDER_H
23
25#include "StopList.h"
26
27//#include "linguisticProcessing/common/BagOfWords/bowText.h"
33
34#include <list>
35#include <set>
36#include <deque>
37
38
39namespace Lima {
40namespace LinguisticProcessing {
41namespace AnalysisDumpers {
42
43
50
51// type definitions
52// ----------------
53private:
54 typedef std::list<LinguisticGraphVertex> VERTICES_TO_EXPLORE_T;
55 typedef std::set<LinguisticGraphVertex> EXPLORED_VERTICES_T;
56
57
58// data
59// ----
60private:
61 VERTICES_TO_EXPLORE_T m_verticesToExplore;
62 EXPLORED_VERTICES_T m_exploredVertices;
63 uint64_t m_currentOffset;
64 MediaId m_language;
65 std::shared_ptr<StopList> m_stopList;
66 const Common::PropertyCode::PropertyAccessor* m_macroAccessor;
67 const Common::PropertyCode::PropertyAccessor* m_microAccessor;
68
69
70// methods
71// -------
72public:
74 const MediaId& language,
75 std::shared_ptr<StopList> stopList);
84 void buildLTRTextFrom(
85 const LinguisticGraph& graph,
87 const LinguisticGraphVertex& graphFirstVertex,
88 const LinguisticGraphVertex& graphLastVertex,
89 boost::shared_ptr<Lima::Common::BagOfWords::LTR_Text> textRep,
90 uint64_t offset);
91
93
94 bool isWordToSelect(
95 const Lima::LimaString& lemma,
96 LinguisticCode macroCategory) const;
97 bool isWordToSelect(
98 const Lima::LimaString& lemma,
99 LinguisticCode macroCategory,
100 LinguisticCode microCategory) const;
101 //}@
102
103private:
104 void addTokensToLTRTextFrom(
105 const LinguisticGraph& graph,
106 const LinguisticGraphVertex& firstVertex,
107 const LinguisticGraphVertex& lastVertex,
108 const LinguisticGraphVertex& graphLastVertex,
109 boost::shared_ptr<Lima::Common::BagOfWords::LTR_Text> textRep,
110 uint64_t offset,
111 uint64_t* tokenCounter);
112 void exploreVerticesFrom(
113 const LinguisticGraphVertex& vertex,
114 const LinguisticGraphVertex& graphLastVertex,
115 const LinguisticGraph& graph);
116 void updateLTR_TokenFromVertex(
117 const LinguisticGraphVertex& vertex,
118 const LinguisticGraph& graph,
119 boost::shared_ptr<Lima::Common::BagOfWords::LTR_Token> tokenRep,
120 uint64_t offset) const;
121};
122
123
124} // AnalysisDumpers
125} // LinguisticProcessing
126} // Lima
127
128
129
130#endif // LIMA_LINGUISTICPROCESSING_LTRTEXTBUILDER_H
#define LIMA_ANALYSISDUMPERS_EXPORT
A graph structure for linguistic analysis.
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
Provide function to read write and check a property.
build a LTRText with all the tokens from the analysis
=======================================================================
=======================================================================
NAUTITIA.
QString LimaString
Definition LimaString.h:33