LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
bowXMLWriter.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 bowXMLWriter.h
9
* @author Besancon Romaric (besanconr@zoe.cea.fr)
10
* @date Wed May 5 2004
11
* copyright Copyright (C) 2004 by CEA LIST
12
* Project BagOfWords
13
*
14
* @brief XML input/output for BoW elements
15
*
16
*
17
***********************************************************************/
18
19
#ifndef BOWXMLWRITER_H
20
#define BOWXMLWRITER_H
21
22
#include "
linguisticProcessing/LinguisticProcessingCommon.h
"
23
#include "
AbstractBoWDocumentHandler.h
"
24
25
#include <string>
26
#include <iostream>
27
28
namespace
Lima
{
29
namespace
Common {
30
namespace
BagOfWords {
31
32
33
class
BoWXMLWriterPrivate;
34
class
BoWToken;
35
class
BoWRelation;
36
class
BoWText;
37
class
BoWDocument;
38
class
IndexElement;
39
40
class
LIMA_BOW_EXPORT
BoWXMLWriter
:
public
AbstractBoWDocumentHandler
41
{
42
public
:
43
BoWXMLWriter
(std::ostream& os,
44
int32_t offset=0);
// general offset to adjust all positions
45
virtual
~BoWXMLWriter
();
46
47
void
writeBoWText(
const
BoWText
* document,
48
const
bool
useIterator,
49
const
bool
useIndexIterator);
50
void
writeBoWToken(
const
BoWToken
* token);
51
void
writeBoWDocument
(
const
BoWDocument
* document,
52
const
bool
useIterator,
53
const
bool
useIndexIterator);
54
55
// root tags for valid XML if several documents
56
void
writeBoWDocumentsHeader();
57
void
writeBoWDocumentsFooter();
58
void
writeDocumentsHeader
()
override
{writeBoWDocumentsHeader();};
59
void
writeDocumentsFooter
()
override
{writeBoWDocumentsFooter();};
60
61
// Implementation of AbstractBoWXMLWriter functions
62
void
openSBoWNode(
const
Lima::Common::Misc::GenericDocumentProperties
* properties,
63
const
std::string& elementName)
override
;
64
void
openSBoWIndexingNode(
const
Lima::Common::Misc::GenericDocumentProperties
* properties,
65
const
std::string& elementName)
override
;
66
void
processSBoWText(
const
BoWText
* boWText,
67
bool
useIterators,
68
bool
useIndexIterator)
override
;
69
void
processProperties(
const
Misc::GenericDocumentProperties
* properties,
70
bool
useIterators,
71
bool
useIndexIterator)
override
;
72
void
closeSBoWNode()
override
;
73
void
writeIndexElement(
const
IndexElement
& element);
74
void
setSpaces(
const
std::string& s);
75
void
incIndent();
76
void
decIndent();
77
78
79
void
setLanguage(
const
Lima::MediaId lang);
80
void
setLanguage(
const
std::string& lang);
81
private
:
82
BoWXMLWriter
(
const
BoWXMLWriter
&);
83
BoWXMLWriter
& operator=(
const
BoWXMLWriter
&);
84
BoWXMLWriterPrivate
* m_d;
85
};
86
87
}
// end namespace
88
}
// end namespace
89
}
// end namespace
90
91
#endif
AbstractBoWDocumentHandler.h
LinguisticProcessingCommon.h
LIMA_BOW_EXPORT
#define LIMA_BOW_EXPORT
Definition
LinguisticProcessingCommon.h:80
Lima::Common::BagOfWords::AbstractBoWDocumentHandler
Definition
AbstractBoWDocumentHandler.h:38
Lima::Common::BagOfWords::BoWDocument
represent a document as a Bag Of Word, with associated document properties.
Definition
bowDocument.h:57
Lima::Common::BagOfWords::BoWText
This class represents a list of elements, that are pointers on polymmorphic tokens that can be simple...
Definition
bowText.h:48
Lima::Common::BagOfWords::BoWToken
This class contains the representation of an element of the bag of words.
Definition
bowToken.h:46
Lima::Common::BagOfWords::BoWXMLWriterPrivate
Definition
bowXMLWriter.cpp:43
Lima::Common::BagOfWords::BoWXMLWriter
Definition
bowXMLWriter.h:41
Lima::Common::BagOfWords::BoWXMLWriter::writeDocumentsFooter
void writeDocumentsFooter() override
Definition
bowXMLWriter.h:59
Lima::Common::BagOfWords::BoWXMLWriter::writeDocumentsHeader
void writeDocumentsHeader() override
Definition
bowXMLWriter.h:58
Lima::Common::BagOfWords::BoWXMLWriter::writeBoWDocument
void writeBoWDocument(const BoWDocument *document, const bool useIterator, const bool useIndexIterator)
Lima::Common::BagOfWords::IndexElement
Represent an element of an index If it is a predicate, its simple term is "PredicateElement" and its ...
Definition
indexElement.h:46
Lima::Common::Misc::GenericDocumentProperties
Definition
genericDocumentProperties.h:58
Lima
NAUTITIA.
Definition
AmosePluginsManager.h:15
lima_linguisticprocessing
src
linguisticProcessing
common
BagOfWords
bowXMLWriter.h
Generated by
1.9.8