LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
BowGeneration.h
Go to the documentation of this file.
1// Copyright 2002-2020 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/***************************************************************************
7 * Copyright (C) 2004-2020 by CEA LIST *
8 * *
9 ***************************************************************************/
10#ifndef LIMA_LINGUISTICPROCESSING_COMPOUNDSBOWGENERATION_H
11#define LIMA_LINGUISTICPROCESSING_COMPOUNDSBOWGENERATION_H
12
15
24
25
26namespace Lima
27{
28namespace Common
29{
30namespace AnnotationGraphs
31{
32 class AnnotationData;
33}
34namespace BagOfWords
35{
36 class BoWNamedEntity;
37 class BoWPredicate;
38}
39}
40namespace LinguisticProcessing
41{
42namespace SemanticAnalysis
43{
45}
46namespace SyntacticAnalysis
47{
48 class SyntacticData;
49}
50namespace AnalysisDumpers
51{
52 class StopList;
53}
54namespace Compounds
55{
56
57class BowGeneratorPrivate;
74{
75 friend class BowGeneratorPrivate;
76public:
78
79 virtual ~BowGenerator();
80 BowGenerator(const BowGenerator&) = delete;
82
83 void init(
85 MediaId language)
86 ;
87
95 std::vector< std::pair< boost::shared_ptr< Common::BagOfWords::BoWRelation >,
96 boost::shared_ptr< Common::BagOfWords::BoWToken > > > buildTermFor(
97 const AnnotationGraphVertex& vx,
98 const AnnotationGraphVertex& tgt,
99 const LinguisticGraph& anagraph,
100 const LinguisticGraph& posgraph,
101 const uint64_t offset,
102 const SyntacticAnalysis::SyntacticData* syntacticData,
103 const Common::AnnotationGraphs::AnnotationData* annotationData,
104 std::set<LinguisticGraphVertex>& visited) const;
105
106 std::vector< std::pair< boost::shared_ptr< Common::BagOfWords::BoWRelation >,
107 boost::shared_ptr< Common::BagOfWords::AbstractBoWElement > > > createAbstractBoWElement(
108 const LinguisticGraphVertex v,
109 const LinguisticGraph& anagraph,
110 const LinguisticGraph& posgraph,
111 const uint64_t offsetBegin,
112 const Common::AnnotationGraphs::AnnotationData* annotationData,
113 std::set<LinguisticGraphVertex>& visited,
114 bool keepAnyway = false) const;
115
128 QList< boost::shared_ptr< Common::BagOfWords::BoWPredicate > > createSemanticRelationPredicate(
129 const LinguisticGraphVertex& lgvs,
130 const AnnotationGraphVertex& agvs,
131 const AnnotationGraphVertex& agvt,
133 const Common::AnnotationGraphs::AnnotationData* annotationData,
134 const LinguisticGraph& anagraph,
135 const LinguisticGraph& posgraph,
136 uint64_t offset,
137 std::set< LinguisticGraphVertex >& visited,
138 bool keepAnyway) const;
139
140
141 /* create a specific entity (BoWNamedEntity): make this function public so that
142 * entities can be created even for vertices that are not in the graph anymore
143 * (to allow BowDumper to dump nested entities)
144 */
145 boost::shared_ptr< Common::BagOfWords::BoWNamedEntity > createSpecificEntity(
146 const LinguisticGraphVertex& vertex,
147 const AnnotationGraphVertex& v,
148 const Common::AnnotationGraphs::AnnotationData* annotationData,
149 const LinguisticGraph& anagraph,
150 const LinguisticGraph& posgraph,
151 const uint64_t offset,
152 bool frompos) const;
153
154private:
156};
157
158} // Compounds
159
160} // LinguisticProcessing
161
162} // Lima
163
164#endif
#define LIMA_ANALYSISDUMPERS_EXPORT
A graph that stores any data (annotations) referencing primarily nodes of a text anlaysis.
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.
Holds an annotation graph and gives an API to manipulate it.
Parameters retrived in the configuration file:
BowGenerator & operator=(const BowGenerator &)=delete
An annotation between two annotation graph vertices denoting the semantic relation(s) holding between...
This class points to a graph, its dependency graph and the structure that holds the maping between th...
AnnotationGraph::vertex_descriptor AnnotationGraphVertex
NAUTITIA.