LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
DictionaryEntry.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
15
16#ifndef DictionaryEntry_H
17#define DictionaryEntry_H
18
19#include "DictionaryExport.h"
25
26namespace Lima {
27namespace LinguisticProcessing {
28namespace Dictionary {
29
31
32public:
33
34 // creates DictionaryEntry
38 const Lima::LimaString& key,
39 unsigned char *stringStartAddr,
40 unsigned char *lingPropertiesStartAddr,
41 unsigned char *startAddr);
42
43 // destroys DictionaryEntry
44 virtual ~DictionaryEntry();
45
46 // Assignment operator. Copies the specified DictionaryEntry
47 // into self. Returns a reference to self.
48 // After assignment, internal iteration pointers of self are reset
50
51 // Reset internal iteration pointers of self.
52 // After this call, self is in its creation state
53 // Returns a reference to self.
55
56 // Returns true if self is empty
57 bool isEmpty() const;
58
59 // Gets the next LingInfoEntry if exists
60 // This call "increments" the internal LingInfoEntry pointer.
61 // If there is no LingInfo anymore, an empty LingInfoEntry is returned
63
64 // Gets the next accented entry if exists
65 // This call "increments" the internal accented entry pointer.
66 // If there is no accented entry anymore, an empty Lima::LimaString is returned
68
69 // Gets the next idiomatic entry if exists
70 // This call "increments" the internal idiomatic entry pointer.
71 // If there is no idiomatic entry anymore, a null integer is returned
72 uint64_t nextIdiomatic();
73
74 // Gets the next hyphen LingInfoEntry if exists
75 // This call "increments" the internal hyphen LingInfoEntry pointer.
76 // If there is no hyphen LingInfo anymore, an empty LingInfoEntry is returned
78
79 // Gets the next ConcatenatedEntry if exists
80 // This call "increments" the internal ConcatenatedEntry pointer.
81 // If there is no Concatenated anymore, an empty ConcatenatedEntry is returned
83
84 // Gets the next LingPropertyEntry if exists
85 // This call "increments" the internal LingPropertyEntry pointer.
86 // If there is no LingPropertyEntry anymore, an empty LingPropertyEntry is returned
88
89 // Returns true if DictionaryEntry has at least one specified component
90 inline bool hasLingInfo() const;
91 inline bool hasAccented() const;
92 inline bool hasIdiomatic() const;
93 inline bool hasHyphenLingInfo() const;
94 inline bool hasConcatenated() const;
95 inline bool hasDefaultProperty() const;
96 // at least LingIfo, HyphenLingInfo, Concatenated
97 inline bool hasAnyLingInfoEntry() const;
98
99 inline unsigned char* lingPropertiesStartAddr() { return m_lingPropertiesStartAddr; }
100 inline const unsigned char* lingPropertiesStartAddr() const { return m_lingPropertiesStartAddr; }
101 inline unsigned char* stringStartAddr() { return m_stringStartAddr; }
102 inline const unsigned char* stringStartAddr() const { return m_stringStartAddr; }
103protected:
104
105private:
106 Lima::LimaString m_key;
107 unsigned char *m_stringStartAddr;
108 unsigned char *m_lingPropertiesStartAddr;
109 unsigned char *m_startAddr;
110 unsigned char *m_endAddr;
111 unsigned char *m_lingInfo;
112 unsigned char *m_endLingInfo;
113 unsigned char *m_accented;
114 unsigned char *m_endAccented;
115 unsigned char *m_idiomatic;
116 unsigned char *m_endIdiomatic;
117 unsigned char *m_hyphenLingInfo;
118 unsigned char *m_endHyphenLingInfo;
119 unsigned char *m_concatenated;
120 unsigned char *m_endConcatenated;
121 unsigned char *m_byDefault;
122 unsigned char *m_endByDefault;
123 bool m_hasLingInfo;
124 bool m_hasAccented;
125 bool m_hasIdiomatic;
126 bool m_hasHyphenLingInfo;
127 bool m_hasConcatenated;
128 bool m_hasDefaultProperty;
129
130};
131
132// Returns true if DictionaryEntry has at least one specified component
133inline bool DictionaryEntry::hasLingInfo() const {return m_hasLingInfo;}
134inline bool DictionaryEntry::hasAccented() const {return m_hasAccented;}
135inline bool DictionaryEntry::hasIdiomatic() const {return m_hasIdiomatic;}
136inline bool DictionaryEntry::hasHyphenLingInfo() const {return m_hasHyphenLingInfo;}
137inline bool DictionaryEntry::hasConcatenated() const {return m_hasConcatenated;}
138inline bool DictionaryEntry::hasDefaultProperty() const {return m_hasDefaultProperty;}
140 return (m_hasLingInfo || m_hasHyphenLingInfo || m_hasConcatenated);}
141
142} //closing namespace Dictionary
143} //closing namespace LinguisticProcessing
144} //closing namespace Lima
145
146
147#endif
#define LIMA_DICTIONARY_EXPORT
LingInfoEntry nextHyphenLingInfo()
Gets the next hyphen LingInfoEntry if exists This call "increments" the internal hyphen LingInfoEntry...
DictionaryEntry & operator=(const DictionaryEntry &)
Assignment operator.
DictionaryEntry & reset()
Reset internal iteration pointers of self.
ConcatenatedEntry nextConcatenated()
Gets the next ConcatenatedEntry if exists This call "increments" the internal ConcatenatedEntry point...
LingPropertyEntry nextLingProperty()
Gets the next LingPropertyEntry if exists This call "increments" the internal LingPropertyEntry point...
uint64_t nextIdiomatic()
Gets the next idiomatic entry if exists This call "increments" the internal idiomatic entry pointer.
Lima::LimaString nextAccented()
Gets the next accented entry if exists This call "increments" the internal accented entry pointer.
LingInfoEntry nextLingInfo()
Gets the next LingInfoEntry if exists This call "increments" the internal LingInfoEntry pointer.
bool isEmpty() const
Returns true if self is empty.
DictionaryEntry(const Lima::LimaString &key, unsigned char *stringStartAddr, unsigned char *lingPropertiesStartAddr, unsigned char *startAddr)
NAUTITIA.
QString LimaString
Definition LimaString.h:33