LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Condition.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// NAUTITIA
7//
8// jys 14-JUL-2002
9//
10// Condition is the class which groups various static
11// conditions associated with a Transition. There are 3 types
12// of static conditions :
13// o value of characters before the current one in the string,
14// o value of characters after the current one in the string,
15// o value of inner automaton return status.
16
17#ifndef LIMA_LINGUISTICPROCESSING_FLATTOKENIZER_Condition_H
18#define LIMA_LINGUISTICPROCESSING_FLATTOKENIZER_Condition_H
19
20#include "FlatTokenizerExport.h"
21#include "Text.h"
22#include "ReturnStatus.h"
23#include "Events.h"
24// #include "linguisticProcessing/core/Tokenizer/ParseMarkup.h"
25
26namespace Lima
27{
28namespace LinguisticProcessing
29{
30namespace FlatTokenizer
31{
32
34
35public:
36 explicit Condition(std::shared_ptr<CharChart> chart);
37 virtual ~Condition();
38
39 // for run-time usage. Within a context, a condition is
40 // fulfilled or not. Return true if fulfilled, false otherwise
41 bool isFulfilled(const Text& text) const;
42
43 inline const std::vector<Events>& before() const {return _before;}
44 inline std::vector<Events>& before() {return _before;}
45
46 inline const std::vector<Events>& after() const {return _after;}
47 inline std::vector<Events>& after() {return _after;}
48
49 inline const Events& status() const {return _status;}
50 inline Events& status() {return _status;}
51
52protected:
53
54private:
55 std::vector<Events> _before;
56 std::vector<Events> _after;
57 Events _status;
58};
59
60} //namespace FlatTokenizer
61} // namespace LinguisticProcessing
62} // namespace Lima
63
64
65#endif
#define LIMA_FLATTOKENIZER_EXPORT
const std::vector< Events > & before() const
Definition Condition.h:43
const std::vector< Events > & after() const
Definition Condition.h:46
NAUTITIA.