LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
bowXMLWriter.cpp
Go to the documentation of this file.
1// Copyright 2002-2022 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/************************************************************************
7 *
8 * @file bowXMLWriter.cpp
9 * @author Besancon Romaric (besanconr@zoe.cea.fr)
10 * @date Wed May 5 2004
11 * copyright Copyright (C) 2004 by CEA LIST
12 *
13 ***********************************************************************/
14
15#include "bowXMLWriter.h"
16#include "bowToken.h"
17#include "bowComplexToken.h"
18#include "BoWRelation.h"
19#include "bowText.h"
20#include "bowDocument.h"
21#include "indexElement.h"
22#include "bowTerm.h"
23#include "bowNamedEntity.h"
24#include "bowDocumentST.h"
25#include "bowTokenIterator.h"
27#include "BoWPredicate.h"
33
34
35using namespace std;
36
37namespace Lima {
38namespace Common {
39namespace BagOfWords {
40
41
43{
44friend class BoWXMLWriter;
45
46 BoWXMLWriterPrivate(std::ostream& os, int32_t offset);
47 virtual ~BoWXMLWriterPrivate();
48
49
50 std::ostream& m_outputStream;
51
52 uint64_t m_currentTokId;
53
54 std::string m_spaces;
56 Lima::MediaId m_language;
57
58 int32_t m_offset;
60 // private functions
61 void setSpaces(const std::string& s);
62
63 void writeBoWToken(const AbstractBoWElement* token);
64 void writeBoWRelation(const BoWRelation* relation);
65 void writeComplexTokenParts(const BoWComplexToken* token);
66 void writeBoWTokenList(const BoWText* text,
67 const bool useIterator,
68 const bool useIndexIterator);
69 void writeGenericDocumentProperties(const Misc::GenericDocumentProperties* prop);
70 void writePredicateRoles(const BoWPredicate* term);
71 template<typename PropertyType>
72 void writeProperty(const std::string& name,
73 const std::string& type,
74 const PropertyType& value);
75 void writeIndexElement(const IndexElement& element);
76
77 // encode possible XML entities
78 std::string xmlString(const std::string& str) const;
79
80 // for indentations
81 void incIndent() { m_spaces+=" "; }
82 void decIndent() { m_spaces.erase(m_spaces.size()-2); }
83
84 void setLanguage(const Lima::MediaId lang);
85 void setLanguage(const std::string& lang);
86};
87
88void BoWXMLWriter::incIndent() { m_d->incIndent() ; }
89void BoWXMLWriter::decIndent() { m_d->decIndent(); }
90
91BoWXMLWriterPrivate::BoWXMLWriterPrivate(std::ostream& os, int32_t offset):
92m_outputStream(os),
93m_currentTokId(0),
94m_spaces(""),
95m_language(0),
96m_offset(offset)
97{
98}
99
100BoWXMLWriterPrivate::~BoWXMLWriterPrivate()
101{
102}
103
104//**********************************************************************
105// writer functions
106//**********************************************************************
107BoWXMLWriter::BoWXMLWriter(std::ostream& os, int32_t offset):
108 m_d(new BoWXMLWriterPrivate(os, offset))
109{
110}
111
113{
114 delete m_d;
115}
116
117/*
118void BoWXMLWriter::setOutputStream(std::ostream& os) {
119 m_os = &os;
120}
121*/
122
124 m_d->m_outputStream << "<?xml-stylesheet type=\"text/xsl\" href=\"bow.xslt\"?>" << endl;
125 m_d->m_outputStream <<"<bowDocuments>" << endl;
126}
127
129 m_d->m_outputStream <<"</bowDocuments>" << endl;
130}
131
133 const Misc::GenericDocumentProperties* /*unused properties*/,
134 const std::string& elementName ) {
135 m_d->m_outputStream << m_d->m_spaces << "<hierarchy elementName=\"" << elementName << "\">" << std::endl;
136 m_d->incIndent();
137}
138
140 const Misc::GenericDocumentProperties* /*unused properties*/,
141 const std::string& elementName ) {
142 m_d->m_currentTokId=0;
143 m_d->m_outputStream << m_d->m_spaces << "<hierarchy elementName=\"" << elementName << "\" indexingNode=\"yes\">" << std::endl;
144 m_d->incIndent();
145}
146
148 m_d->m_outputStream <<m_d->m_spaces <<"</hierarchy>" << std::endl;
149 m_d->decIndent();
150}
151
152void BoWXMLWriter::processSBoWText( const BoWText* boWText, bool useIterator,
153 bool useIndexIterator) {
154#ifdef DEBUG_LP
156 LDEBUG << "BoWXMLWriter::processSBoWText";
157#endif
158 m_d->m_language = Common::MediaticData::MediaticData::single().getMediaId ( boWText->lang );
159
160 m_d->writeBoWTokenList(boWText,useIterator,useIndexIterator);
161}
162
164 const Misc::GenericDocumentProperties* properties, bool /*unused useIterators*/,
165 bool /*useIndexIterator*/) {
166 m_d->writeGenericDocumentProperties(properties);
167}
168
170 const BoWText* text,
171 const bool useIterator,
172 const bool useIndexIterator) {
173 m_d->m_language = Common::MediaticData::MediaticData::single().getMediaId ( text->lang );
174
175 m_d->m_spaces="";
176 m_d->m_outputStream <<"<bowText>" << std::endl;
177 m_d->incIndent();
178 m_d->writeBoWTokenList(text,useIterator,useIndexIterator);
179 m_d->decIndent();
180 m_d->m_outputStream <<"</bowText>" << std::endl;
181}
183{
184 m_d->writeBoWToken(token);
185}
186// definition of template can be in .cpp because all needed
187// instanciations are in this definition file
188template<typename PropertyType>
189void BoWXMLWriterPrivate::writeProperty( const std::string& name,
190 const std::string& type,
191 const PropertyType& value) {
192 m_outputStream <<m_spaces << "<property name=\"" << name
193 << "\" type=\""<< type
194 << "\" value=\"" << value
195 << "\"/>" << std::endl;
196}
197
198void BoWXMLWriterPrivate::writeGenericDocumentProperties(
200
201 m_outputStream <<m_spaces << "<properties>" << std::endl;
202 incIndent();
203
204 // write values of properties whose type is int
206 {
207 std::pair<IntIter,IntIter> ret = prop->getIntProperties();
208 for( IntIter it = ret.first ; it != ret.second ; it++ ) {
209 std::pair<std::string,uint64_t> elmt = *it;
210 m_outputStream <<m_spaces << "<property name=\"" << elmt.first << "\""
211 << " type=\"int\""
212 << " value=\"" << elmt.second << "\"/>"
213 << std::endl;
214 }
215 }
217 {
218 std::pair<StringIter,StringIter> ret = prop->getStringProperties();
219 for( StringIter it = ret.first ; it != ret.second ; it++ ) {
220 std::pair<std::string,std::string> elmt = *it;
221 m_outputStream <<m_spaces << "<property name=\"" << elmt.first << "\""
222 << " type=\"string\""
223 << " value=\"" << xmlString(elmt.second) << "\"/>"
224 << std::endl;
225 }
226 }
228 {
229 std::pair<DateIter,DateIter> ret = prop->getDateProperties();
230 for( DateIter it = ret.first ; it != ret.second ; it++ ) {
231 std::pair<std::string,QDate> elmt = *it;
232 m_outputStream <<m_spaces << "<property name=\"" << elmt.first << "\""
233 << " type=\"date\""
234 << " value=\"" << elmt.second.toString("yyyyMMdd").toUtf8().data() << "\"/>"
235 << std::endl;
236 }
237 }
239 {
240 std::pair<DateIntervIter,DateIntervIter> ret = prop->getDateIntervalProperties();
241 for( DateIntervIter it = ret.first ; it != ret.second ; it++ ) {
242 std::pair<std::string,std::pair<QDate,QDate> > elmt = *it;
243 m_outputStream <<m_spaces << "<property name=\"" << elmt.first << "\""
244 << " type=\"dateRange\""
245 << " valueBegin=\"" << (elmt.second).first.toString("yyyyMMdd").toUtf8().data() << "\""
246 << " valueEnd=\"" << (elmt.second).second.toString("yyyyMMdd").toUtf8().data()
247 << "\"/>" << std::endl;
248 }
249 }
250 std::pair<Misc::MultiValuedPropertyIterator<std::string>,
251 Misc::MultiValuedPropertyIterator<std::string> > svnit =
253// m_outputStream << "BoWXMLWriter::writeGenericDocumentProperties: has multi-valued string properties "
254// << (svnit.first != svnit.second ? "yes" : "no" ) << std::endl;
255 for( ; svnit.first != svnit.second; (svnit.first)++ ) {
256 std::string propName = *(svnit.first);
257 std::pair<Misc::StringPropMultIter,Misc::StringPropMultIter> svit = prop->getMultipleStringPropValue(propName);
258 for( ; svit.first != svit.second ; (svit.first)++ ) {
259 m_outputStream <<m_spaces << "<property name=\"" << propName << "\""
260 << " type=\"multString\""
261 << " value=\"" << xmlString(*(svit.first)) << "\"/>"
262 << std::endl;
263 }
264 }
265 std::pair<Misc::MultiValuedPropertyIterator<std::pair<std::string,float> >,
266 Misc::MultiValuedPropertyIterator<std::pair<std::string,float> > > swnit =
268// m_outputStream << "BoWXMLWriter::writeGenericDocumentProperties: has multi-valued string properties "
269// << (swnit.first != swnit.second ? "yes" : "no" ) << std::endl;
270 for( ; swnit.first != swnit.second; (swnit.first)++ ) {
271 std::string propName = *(swnit.first);
272 std::pair<Misc::WeightedPropMultIter,Misc::WeightedPropMultIter> svit = prop->getMultipleWeightedPropValue(propName);
273 for( ; svit.first != svit.second ; (svit.first)++ ) {
274 m_outputStream <<m_spaces << "<property name=\"" << propName << "\""
275 << " type=\"multWeightedId\""
276 << "\" value=\"" << xmlString((*(svit.first)).first)
277 << "\" weight=\"" << (*(svit.first)).second << "\"/>"
278 << std::endl;
279 }
280 }
281
282 decIndent();
283 m_outputStream <<m_spaces << "</properties>" << std::endl;
284}
285
286void BoWXMLWriterPrivate::writePredicateRoles(const BoWPredicate* term)
287{
288 m_outputStream <<m_spaces << "<roles>" << std::endl;
289 incIndent();
290 for (auto it = term->roles().begin(); it != term->roles().end(); it++)
291 {
292 m_outputStream <<m_spaces << "<role type=\""
293 << (it.key().isNull() ? "" : Misc::limastring2utf8stdstring(MediaticData::MediaticData::single().getEntityName(it.key())))
294 << "\" >" << std::endl;
295 incIndent();
296 writeBoWToken(&*it.value());
297 decIndent();
298 m_outputStream <<m_spaces << "</role>" << std::endl;
299 }
300 decIndent();
301 m_outputStream <<m_spaces << "</roles>" << std::endl;
302 term->roles();
303}
304
305void BoWXMLWriterPrivate::writeBoWTokenList(
306 const BoWText* text,
307 const bool useIterator,
308 const bool useIndexIterator) {
309
310 m_outputStream <<m_spaces << "<tokens>" << std::endl;
311 incIndent();
312 if (useIterator)
313 {
314 BoWTokenIterator it(*text);
315 while (! it.isAtEnd())
316 {
317 writeBoWToken( &*it.getElement());
318 it++;
319 }
320 }
321 else if (useIndexIterator)
322 {
323 IndexElementIterator it(*text);
324 while (! it.isAtEnd())
325 {
326 writeIndexElement(it.getElement());
327 it++;
328 }
329 }
330 else
331 {
332 for (const auto& tok: *text) {
333 writeBoWToken( &*tok);
334 }
335 }
336 decIndent();
337 m_outputStream <<m_spaces << "</tokens>" << std::endl;
338}
339
340void BoWXMLWriterPrivate::writeIndexElement(
341 const IndexElement& element) {
342 m_outputStream << m_spaces << "<term "
343 << "id=\"" << element.getId() << "\"";
344 if (element.empty()) {
345 m_outputStream << "/>" << endl;
346 return;
347 }
348 if (element.isSimpleTerm()) {
349 std::string cat;
350 try
351 {
352 cat = static_cast<const MediaticData::LanguageData&>(MediaticData::MediaticData::single().mediaData(m_language)).getPropertyCodeManager().getPropertyManager("MACRO").getPropertySymbolicValue(element.getCategory());
353 }
355 {
357 LERROR << "BoWXMLWriterPrivate::writeIndexElement Catched MediaNotInitialized:" << e.what();
358 }
359 m_outputStream << " lemma=\"" << xmlString(Misc::limastring2utf8stdstring(element.getSimpleTerm()))
360 << "\" category=\"" << cat
361 << "\" position=\"" << element.getPosition() + m_offset
362 << "\" length=\"" << element.getLength() << "\"";
363 if (element.isNamedEntity()) {
364 m_outputStream << " neType=\"" << Misc::limastring2utf8stdstring(MediaticData::MediaticData::single().getEntityName(element.getNamedEntityType())) << "\"";
365 m_outputStream << " type=\"" << BoWType::BOW_NAMEDENTITY << "\"";
366 }
367 else {
368 m_outputStream << " type=\"" << BoWType::BOW_TOKEN << "\"";
369 }
370 m_outputStream << "/>" << endl;
371 return;
372 }
373
374 // compound
375 if (element.isNamedEntity()) {
376 m_outputStream << " neType=\"" << Misc::limastring2utf8stdstring(MediaticData::MediaticData::single().getEntityName(element.getNamedEntityType())) << "\"";
377 m_outputStream << " type=\"" << BoWType::BOW_NAMEDENTITY << "\"";
378 }
379 else {
380 m_outputStream << " type=\"" << BoWType::BOW_TERM << "\"";
381 }
382 m_outputStream << ">" << endl
383 << m_spaces << " <structure>" << endl;
384
385 for (uint64_t i(0),size=element.getStructure().size(); i<size; i++) {
386 m_outputStream << m_spaces << " <termRef id=\""
387 << element.getStructure()[i]
388 << "\" rel=\"" << element.getRelations()[i]
389 << "\"/>" << endl;
390
391 }
392 m_outputStream << m_spaces << " </structure>" << endl
393 << m_spaces << "</term>" << endl;
394}
395
396void BoWXMLWriterPrivate::writeBoWRelation(const BoWRelation* relation) {
397 m_outputStream <<m_spaces << "<bowRelation "
398 << "realization=\""
399 << xmlString(Misc::limastring2utf8stdstring(relation->getRealization( )))
400 << "\" type=\"" << relation->getType() << "\"/>"
401 << std::endl;
402}
403
404void BoWXMLWriterPrivate::writeBoWToken(
405 const BagOfWords::AbstractBoWElement* token ) {
406 m_currentTokId++;
407 const BoWToken* tok = 0;
408 switch(token->getType()) {
409 case BoWType::BOW_TOKEN: {
410 tok = static_cast<const BoWToken*>(token);
411 std::string cat = static_cast<const MediaticData::LanguageData&>(MediaticData::MediaticData::single().mediaData(m_language)).getPropertyCodeManager().getPropertyManager("MACRO").getPropertySymbolicValue(tok->getCategory());
412
413 m_outputStream <<m_spaces << "<bowToken "
414 << "id=\"" << m_currentTokId
415 << "\" lemma=\"" << xmlString(Misc::limastring2utf8stdstring(tok->getLemma()))
416 << "\" category=\"" << cat
417 <<"\" position=\"" << tok->getPosition() + m_offset
418 << "\" length=\"" << tok->getLength() << "\""
419 << "/>" << std::endl;
420 break;
421 }
423 const BoWPredicate* term=static_cast<const BoWPredicate*>(token);
424 m_outputStream <<m_spaces << "<bowPredicate "
425 << "id=\"" << m_currentTokId
426 << "\" lemma=\"" << xmlString(Misc::limastring2utf8stdstring(MediaticData::MediaticData::single().getEntityName(term->getPredicateType())))
427 <<"\" position=\"" << term->getPosition() + m_offset
428 << "\" length=\"" << term->getLength() << "\""
429 << ">" << std::endl;
430 incIndent();
431 writePredicateRoles(term);
432 decIndent();
433 m_outputStream <<m_spaces << "</bowPredicate>" << std::endl;
434 break;
435 }
436 case BoWType::BOW_TERM: {
437 const BoWTerm* term=static_cast<const BoWTerm*>(token);
438 std::string cat = static_cast<const MediaticData::LanguageData&>(MediaticData::MediaticData::single().mediaData(m_language)).getPropertyCodeManager().getPropertyManager("MACRO").getPropertySymbolicValue(term->getCategory());
439
440 m_outputStream <<m_spaces << "<bowTerm "
441 << "id=\"" << m_currentTokId
442 << "\" lemma=\"" << xmlString(Misc::limastring2utf8stdstring(term->getLemma()))
443 << "\" category=\"" << cat
444 <<"\" position=\"" << term->getPosition() + m_offset
445 << "\" length=\"" << term->getLength() << "\""
446 << ">" << std::endl;
447 incIndent();
448 writeComplexTokenParts( term);
449 decIndent();
450 m_outputStream <<m_spaces << "</bowTerm>" << std::endl;
451 break;
452 }
454 const BoWNamedEntity* ne=static_cast<const BoWNamedEntity*>(token);
455 std::string cat = static_cast<const MediaticData::LanguageData&>(MediaticData::MediaticData::single().mediaData(m_language)).getPropertyCodeManager().getPropertyManager("MACRO").getPropertySymbolicValue(ne->getCategory());
456
457 m_outputStream <<m_spaces << "<bowNamedEntity "
458 << "id=\"" << m_currentTokId
459 << "\" lemma=\"" << xmlString(Misc::limastring2utf8stdstring(ne->getLemma()))
460 << "\" category=\"" << cat
461 <<"\" position=\"" << ne->getPosition() + m_offset
462 << "\" length=\"" << ne->getLength()
463 << "\" type=\""
464 << Misc::limastring2utf8stdstring(MediaticData::MediaticData::single().getEntityName(ne->getNamedEntityType()))
465 << "\""
466 << ">" << std::endl;
467 incIndent();
468 writeComplexTokenParts( ne);
469 for (std::map<std::string, LimaString>::const_iterator
470 feature=ne->getFeatures().begin();
471 feature!=ne->getFeatures().end(); feature++) {
472 m_outputStream <<m_spaces << "<feature name=\"" << (*feature).first
473 << "\" value=\""
474 << xmlString(Common::Misc::limastring2utf8stdstring((*feature).second))
475 << "\"/>" <<std::endl;
476 }
477 decIndent();
478 m_outputStream <<m_spaces << "</bowNamedEntity>" << std::endl;
479 break;
480 }
481 default:
483 LERROR << "Invalid BoW token: no type token";
484 }
485}
486
487void BoWXMLWriterPrivate::writeComplexTokenParts(const BoWComplexToken* token) {
488 if (token->getParts().empty()) {
489 return;
490 }
491 m_outputStream <<m_spaces << "<parts head=\""<< token->getHead() << "\">" << std::endl;
492 incIndent();
493 for (std::deque<BoWComplexToken::Part>::const_iterator
494 part=token->getParts().begin();
495 part!=token->getParts().end(); part++)
496 {
497// m_outputStream <<m_spaces << "<part>" << std::endl;
498// incIndent();
499 if ((*part).getBoWRelation()!=0)
500 {
501 writeBoWRelation( &*(*part).getBoWRelation());
502 }
503 writeBoWToken( &*(*part).getBoWToken());
504
505// decIndent();
506// m_outputStream <<m_spaces << "</part>" << std::endl;
507 }
508 decIndent();
509 m_outputStream <<m_spaces << "</parts>" << std::endl;
510}
511
512// helper function: encode XML entities (to ensure the output to be valid XML)
513std::string BoWXMLWriterPrivate::xmlString(const std::string& s) const
514{
515 static char charsToEncode[4]={'&','"','<','>'};
516 static string xmlEntities[4]={"&amp;","&quot;","&lt;","&gt;"};
517 // &amp; first is important because otherwise, replace & in other entities
518
519 string str(s);
520 for (uint64_t i=0; i<4; i++) {
521 //uint64_t prev=0;
522 //uint64_t k=str.find(charsToEncode[i],prev);
523 // uint64_t prev=0;
524 //uint64_t k=str.find(charsToEncode[i],prev);
525 string::size_type prev=0;
526 string::size_type k=str.find(charsToEncode[i],prev);
527 while (k!=string::npos) {
528 str.replace(k,1,xmlEntities[i]);
529 prev=k+1; //+1 is enough even is more characters have been added
530 k=str.find(charsToEncode[i],prev);
531 }
532 }
533 return str;
534}
535
536void BoWXMLWriterPrivate::setSpaces(const std::string& s)
537{
538 m_spaces=s;
539}
540
541void BoWXMLWriter::setSpaces(const std::string& s)
542{
543 m_d->setSpaces(s);
544}
545
546void BoWXMLWriter::setLanguage(const Lima::MediaId lang)
547{
548 m_d->setLanguage(lang);
549}
550
551void BoWXMLWriterPrivate::setLanguage(const Lima::MediaId lang)
552{
553 m_language = lang;
554}
555
556void BoWXMLWriter::setLanguage(const std::string& lang)
557{
558 m_d->setLanguage(lang);
559}
560
561void BoWXMLWriterPrivate::setLanguage(const std::string& lang)
562{
563 lang.empty()
564 ? MediaId(0)
565 : m_language = MediaticData::MediaticData::single().getMediaId (lang);
566}
567
569{
570 m_d->writeIndexElement(element);
571}
572
573
574} // end namespace
575} // end namespace
576} // end namespace
#define LDEBUG
Definition LimaCommon.h:157
#define LERROR
Definition LimaCommon.h:161
#define BOWLOGINIT
Definition LimaCommon.h:201
This class is the abstract base class of all elements that can be stored in a BoWText.
This is a complex token for an index.
This is a BoW element used to represent a predicate (n-ary relation, template or semantic frame).
This class is used to type the relation between a part and its enclosing complex token.
Definition BoWRelation.h:50
This class represents a list of elements, that are pointers on polymmorphic tokens that can be simple...
Definition bowText.h:48
This class contains the representation of an element of the bag of words.
Definition bowToken.h:46
void writeBoWText(const BoWText *document, const bool useIterator, const bool useIndexIterator)
void setSpaces(const std::string &s)
void processSBoWText(const BoWText *boWText, bool useIterators, bool useIndexIterator) override
void openSBoWIndexingNode(const Lima::Common::Misc::GenericDocumentProperties *properties, const std::string &elementName) override
void openSBoWNode(const Lima::Common::Misc::GenericDocumentProperties *properties, const std::string &elementName) override
void setLanguage(const Lima::MediaId lang)
void writeIndexElement(const IndexElement &element)
void processProperties(const Misc::GenericDocumentProperties *properties, bool useIterators, bool useIndexIterator) override
BoWXMLWriter(std::ostream &os, int32_t offset=0)
void writeBoWToken(const BoWToken *token)
Represent an element of an index If it is a predicate, its simple term is "PredicateElement" and its ...
holds data about codes and names for grammatical categories, etc.
const std::string & getMediaId(MediaId idNum) const
const MediaData & mediaData(MediaId media) const
std::pair< DateIntervalPropertiesIterator, DateIntervalPropertiesIterator > getDateIntervalProperties() const
std::pair< StringPropMultIter, StringPropMultIter > getMultipleStringPropValue(std::string propName) const
Read access functions for "multiple-valued" property propName Return a pair of iterator (begin,...
std::pair< DatePropertiesIterator, DatePropertiesIterator > getDateProperties() const
std::pair< MultiValuedPropertyIterator< std::pair< std::string, float > >, MultiValuedPropertyIterator< std::pair< std::string, float > > > getWeightedPropPropertyNames() const
std::pair< MultiValuedPropertyIterator< std::string >, MultiValuedPropertyIterator< std::string > > getStringPropertyNames() const
Read access functions for all "multiple valued" properties return an iterator of names Types may be a...
std::pair< IntPropertiesIterator, IntPropertiesIterator > getIntProperties() const
std::map< std::string, std::string >::const_iterator StringPropertiesIterator
std::map< std::string, std::pair< QDate, QDate > >::const_iterator DateIntervalPropertiesIterator
std::map< std::string, QDate >::const_iterator DatePropertiesIterator
std::pair< StringPropertiesIterator, StringPropertiesIterator > getStringProperties() const
std::pair< WeightedPropMultIter, WeightedPropMultIter > getMultipleWeightedPropValue(std::string propName) const
std::map< std::string, uint64_t >::const_iterator IntPropertiesIterator
Read access functions for all "only once valued" properties return an iterator Types may be any of (u...
virtual const char * what() const override
Definition LimaCommon.h:280
Use this exception to signal that a media is used which has not been initialized.
Definition LimaCommon.h:369
static const MediaticData & single()
const singleton accessor
Definition Singleton.h:51
@ BOW_TERM
the AbstractBoWElement is a multi-term
@ BOW_NAMEDENTITY
the AbstractBoWElement is a named entity
@ BOW_TOKEN
the AbstractBoWElement is a simple token
@ BOW_PREDICATE
the AbstractBoWElement is a predicate (n-ary relation, template or semantic frame
std::string limastring2utf8stdstring(const Lima::LimaString &phrase, uint32_t size0)
Convert a wide string to a string , in dest up to size bytes.
NAUTITIA.
STL namespace.