LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
TemporalSegmentationFeatures.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
6/************************************************************************
7 *
8 * @file TemporalSegmentationFeatures.h
9 * @author Romaric Besancon (romaric.besancon@cea.fr)
10 * @date Thu Feb 10 2011
11 * copyright Copyright (C) 2011 by CEA LIST
12 * Project LIMA
13 *
14 * @brief Segment features for temporal segmentation
15 *
16 *
17 ***********************************************************************/
18
19#ifndef TEMPORALSEGMENTATIONFEATURES_H
20#define TEMPORALSEGMENTATIONFEATURES_H
21
29
30namespace Lima {
31namespace LinguisticProcessing {
32
33//----------------------------------------------------------------------
34// segment features for dumper used for temporal segmentation
35
36//----------------------------------------------------------------------
37// check if an entity of a given type exists in the segment
38#define SegmentFeatureEntity_ID "entity"
40public:
41 SegmentFeatureEntity(MediaId language, const std::string& complement="");
43
44 void update(const AnalysisContent& analysis);
45
46 std::string
48 const Segment& seg) const;
49private:
50 const std::string m_entityName;
52 const Common::AnnotationGraphs::AnnotationData* m_annotationData;
53
54 bool isVertexInPosGraphAnEntityOfType(LinguisticGraphVertex v,
55 const Common::AnnotationGraphs::AnnotationData* annotationData,
57
58 bool isAnEntityOfType(LinguisticGraphVertex v,
59 const Common::AnnotationGraphs::AnnotationData* annotationData,
61 const std::string& graphId) const;
62
63};
64
65//----------------------------------------------------------------------
66#define SegmentFeatureEntityInData_ID "entityInData"
68public:
69 SegmentFeatureEntityInData(MediaId language, const std::string& complement="");
71
72 void update(const AnalysisContent& analysis);
73
74 std::string
76 const Segment& seg) const;
77private:
78 std::string m_entityName;
79 std::string m_dataName;
82};
83
84//----------------------------------------------------------------------
85// give the rank of the segment
86#define SegmentFeatureRank_ID "rank"
88public:
89 SegmentFeatureRank(MediaId language, const std::string& complement="");
91
92 void update(const AnalysisContent& analysis);
93
94 std::string
96 const Segment& seg) const;
97private:
98 std::string m_data;
99 const SegmentationData* m_segmData;
100};
101
102//----------------------------------------------------------------------
103// give the number of verbs with a given tense
104#define SegmentFeatureCheckProperty_ID "checkProperty"
106public:
107 SegmentFeatureCheckProperty(MediaId language, const std::string& complement="");
109
110 void update(const AnalysisContent& analysis);
111
112 std::string
113 getValue(const LinguisticAnalysisStructure::AnalysisGraph* graph,
114 const Segment& seg) const;
115private:
116 std::string m_propertyName;
117 std::string m_propertyValue;
118 LinguisticCode m_value;
119 const Common::PropertyCode::PropertyAccessor* m_propertyAccessor;
120
121 bool isProperty(LinguisticGraphVertex v,
122 const LinguisticGraph* graph,
123 LinguisticCode propertyValue) const;
124};
125
126//----------------------------------------------------------------------
127// give the number of verbs with a given tense
128#define SegmentFeatureInSegment_ID "segmentType"
130 public:
131 SegmentFeatureInSegment(MediaId language, const std::string& complement="");
133
134 void update(const AnalysisContent& analysis);
135
136 std::string
137 getValue(const LinguisticAnalysisStructure::AnalysisGraph* graph,
138 const Segment& seg) const;
139 private:
140 std::string m_segmentData;
141 const SegmentationData* m_data;
142};
143
144} // end namespace
145} // end namespace
146
147#endif
This file is the main header file for the data related to annotation graphs.
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.
#define LIMA_TEXTSEGMENTATION_EXPORT
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
Holds an annotation graph and gives an API to manipulate it.
Provide function to read write and check a property.
An AnalysisData containing a LinguisticGraph with a language and an id.
NAUTITIA.