42namespace LinguisticProcessing {
50 m_stringStartAddr(NULL),
51 m_lingPropertiesStartAddr(NULL),
60 m_hyphenLingInfo(NULL),
61 m_endHyphenLingInfo(NULL),
63 m_endConcatenated(NULL),
68 m_hasIdiomatic(false),
69 m_hasHyphenLingInfo(false),
70 m_hasConcatenated(false),
71 m_hasDefaultProperty(false)
81 m_stringStartAddr(entry.m_stringStartAddr),
82 m_lingPropertiesStartAddr(entry.m_lingPropertiesStartAddr),
91 m_hyphenLingInfo(NULL),
92 m_endHyphenLingInfo(NULL),
94 m_endConcatenated(NULL),
99 m_hasIdiomatic(false),
100 m_hasHyphenLingInfo(false),
101 m_hasConcatenated(false),
102 m_hasDefaultProperty(false)
104 if (entry.m_startAddr != NULL) {
105 uint64_t entrySize = entry.m_endAddr - entry.m_startAddr;
106 m_startAddr =
new unsigned char[entrySize];
107 memcpy(m_startAddr, entry.m_startAddr, entrySize);
113 unsigned char *stringStartAddr,
114 unsigned char *lingPropertiesStartAddr,
115 unsigned char *startAddr) :
118 m_stringStartAddr(stringStartAddr),
119 m_lingPropertiesStartAddr(lingPropertiesStartAddr),
127 m_endIdiomatic(NULL),
128 m_hyphenLingInfo(NULL),
129 m_endHyphenLingInfo(NULL),
130 m_concatenated(NULL),
131 m_endConcatenated(NULL),
133 m_endByDefault(NULL),
134 m_hasLingInfo(false),
135 m_hasAccented(false),
136 m_hasIdiomatic(false),
137 m_hasHyphenLingInfo(false),
138 m_hasConcatenated(false),
139 m_hasDefaultProperty(false)
141 if (startAddr != NULL) {
142 unsigned char *ptr = startAddr;
144 unsigned char *endAddr = num + ptr;
145 uint64_t entrySize = endAddr - startAddr;
146 m_startAddr =
new unsigned char[entrySize];
147 memcpy(m_startAddr, startAddr, entrySize);
156 delete[] m_startAddr;
165 m_key = dictionaryEntry.m_key;
166 m_stringStartAddr = dictionaryEntry.m_stringStartAddr;
167 m_lingPropertiesStartAddr = dictionaryEntry.m_lingPropertiesStartAddr;
168 delete[] m_startAddr;
170 if (dictionaryEntry.m_startAddr != NULL)
172 uint64_t entrySize = dictionaryEntry.m_endAddr - dictionaryEntry.m_startAddr;
173 m_startAddr =
new unsigned char[entrySize];
174 memcpy(m_startAddr, dictionaryEntry.m_startAddr, entrySize);
188 m_endLingInfo = NULL;
190 m_endAccented = NULL;
192 m_endIdiomatic = NULL;
193 m_hyphenLingInfo = NULL;
194 m_endHyphenLingInfo = NULL;
195 m_concatenated = NULL;
196 m_endConcatenated = NULL;
198 m_endByDefault = NULL;
199 m_hasLingInfo =
false;
200 m_hasAccented =
false;
201 m_hasIdiomatic =
false;
202 m_hasHyphenLingInfo =
false;
203 m_hasConcatenated =
false;
204 m_hasDefaultProperty =
false;
205 if (m_startAddr != NULL) {
206 unsigned char *ptr = m_startAddr;
208 m_endAddr = num + ptr;
209 if (ptr < m_endAddr) {
211 m_endLingInfo = num + ptr;
213 m_hasLingInfo = (m_endLingInfo > m_lingInfo);
215 if (ptr < m_endAddr) {
217 m_endAccented = num + ptr;
219 m_hasAccented = (m_endAccented > m_accented);
221 if (ptr < m_endAddr) {
223 m_endIdiomatic = num + ptr;
225 m_hasIdiomatic = (m_endIdiomatic > m_idiomatic);
226 ptr = m_endIdiomatic;
227 if (ptr < m_endAddr) {
229 m_endHyphenLingInfo = num + ptr;
230 m_hyphenLingInfo = ptr;
231 m_hasHyphenLingInfo = (m_endHyphenLingInfo > m_hyphenLingInfo);
232 ptr = m_endHyphenLingInfo;
233 if (ptr < m_endAddr) {
235 m_endConcatenated = num + ptr;
236 m_concatenated = ptr;
237 m_hasConcatenated = (m_endConcatenated > m_concatenated);
238 ptr = m_endConcatenated;
239 if (ptr < m_endAddr) {
241 ptr = m_lingPropertiesStartAddr + offset;
244 m_endByDefault = ptr;
249 m_endByDefault = num + ptr;
252 m_hasDefaultProperty = (m_endByDefault > m_byDefault);
266 return (m_startAddr == NULL);
275 if (m_lingInfo < m_endLingInfo) {
276 unsigned char *lingInfo = m_lingInfo;
278 return LingInfoEntry(m_key, m_stringStartAddr, m_lingPropertiesStartAddr, lingInfo);
290 if (m_accented < m_endAccented) {
303 if (m_idiomatic < m_endIdiomatic)
315 if (m_hyphenLingInfo < m_endHyphenLingInfo) {
316 unsigned char *hyphenLingInfo = m_hyphenLingInfo;
318 return LingInfoEntry(m_key, m_stringStartAddr, m_lingPropertiesStartAddr, hyphenLingInfo);
330 if (m_concatenated < m_endConcatenated)
332 unsigned char *concatenated = m_concatenated;
348 if (m_startAddr == NULL)
352 if (m_byDefault < m_endByDefault)
static LinguisticCode decodeFromBinary(std::istream &is)
uint64_t getEncodedNumber(unsigned char *&ptr) const
BinaryEntry & operator=(const BinaryEntry &entry)
unsigned char * nextField(unsigned char *&ptr) const
Lima::LimaString getUtf8StringNoMove(unsigned char *ptr) const
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...
virtual ~DictionaryEntry()
destroys DictionaryEntry
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()
creates DictionaryEntry