LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
setTransition.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 setTransition.h
9 * @author besancon (besanconr@zoe.cea.fr)
10 * @date Fri Sept 19 2003
11 * copyright Copyright (C) 2003 by CEA LIST
12 * Project Automaton
13 *
14 * @brief representation of set transitions : the transitions are
15 * a set of simple words (for better search in gazeteers)
16 *
17 ***********************************************************************/
18
19#ifndef SETTRANSITION_H
20#define SETTRANSITION_H
21
22#include "AutomatonExport.h"
23#include "transitionUnit.h"
24#include "automatonCommon.h"
25#include <set>
26
27namespace Lima {
28namespace LinguisticProcessing {
29namespace Automaton {
30
32{
33 public:
35 SetTransition(const std::set<Tword>& words, bool keep=true);
37 virtual ~SetTransition();
38 SetTransition& operator = (const SetTransition&);
39
40 SetTransition* clone() const override;
41 SetTransition* create() const override;
42
43 std::string printValue() const override;
44 bool operator== (const TransitionUnit&) const override;
45
46 const std::set<Tword>& getWords() const { return m_words; }
47 std::set<Tword>& getWords() { return m_words; }
48
49 bool compare(const LinguisticAnalysisStructure::AnalysisGraph& graph,
50 const LinguisticGraphVertex& vertex,
51 AnalysisContent& analysis,
53 const LinguisticAnalysisStructure::MorphoSyntacticData* data) const override;
54
55 TypeTransition type() const override;
56
57
58 private:
59 std::set<Tword> m_words;
60
61 // helper functions for destructor/copy constructor/assignement operator
62 void clean();
63 void copy(const SetTransition& t);
64
65};
66
67/***********************************************************************/
68// inline functions
69/***********************************************************************/
70inline TypeTransition SetTransition::type() const { return T_SET; }
72 return new SetTransition(*this); }
74 return new SetTransition(); }
75
76} // namespace end
77} // namespace end
78} // namespace end
79
80#endif
#define LIMA_AUTOMATON_EXPORT
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
An AnalysisData containing a LinguisticGraph with a language and an id.
NAUTITIA.