LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
contentDocument.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
2//
3// SPDX-License-Identifier: MIT
4
5/************************************************************************
6 * @file contentDocument.h
7 * @author Besancon Romaric
8 * @date Wed Oct 29 13:22:02 2003
9 *
10 * @brief the representation of the content parts of a document,
11 * and its meta-data
12 *
13 *
14 ***********************************************************************/
15
17#include "documentProperty.h"
22
23#include <deque>
24#include <string>
25
26#ifndef CONTENTDOCUMENT_H
27#define CONTENTDOCUMENT_H
28
29namespace Lima {
30namespace DocumentsReader {
31
32class AbstractStructuredDocumentElement;
33class DiscardableDocumentElement;
34class IndexingDocumentElement;
35class HierarchyDocumentElement;
36class DocumentPropertyElement;
37class PresentationDocumentElement;
38class IgnoredDocumentElement;
39
43class ContentStructuredDocument : public std::deque<AbstractStructuredDocumentElement*>,
45{
46public:
52
54
56 unsigned int getOffset();
57
59 void addPart(const Lima::LimaString& text, const unsigned int offset);
61 DiscardableDocumentElement* pushDiscardableChild( const QString& elementName, unsigned int parserOffset );
63 DocumentPropertyElement* addPropertyChild( const QString& elementName, unsigned int parserOffset,
64 const DocumentPropertyType& type );
66 HierarchyDocumentElement* pushHierarchyChild( const QString& elementName, unsigned int parserOffset, const DocumentPropertyType& propType );
67 IndexingDocumentElement* pushIndexingChild( const QString& elementName, unsigned int parserOffset, const DocumentPropertyType& propType );
68 IgnoredDocumentElement* pushIgnoredChild( const QString& elementName, unsigned int parserOffset, const DocumentPropertyType& propType );
70 PresentationDocumentElement* pushPresentationChild( const QString& elementName, unsigned int parserOffset );
71
72 void popDiscardableElement(unsigned int parserOffset);
73 void popIndexingElement( unsigned int parserOffset );
74 void popPresentationElement( unsigned int parserOffset );
75 void popPropertyElement(unsigned int parserOffset);
76 void popHierarchyElement(unsigned int parserOffset);
77 void popIgnoredElement(unsigned int parserOffset);
78
79// void reportTextOfLastElement( );
81 void setDataToLastElement( const DocumentPropertyType& property,
82 const std::string& data, StructuredXmlDocumentHandler* processor );
84 const DocumentPropertyType& property, const std::string& data,
86 static void parseDate(const std::string& dateStr,
87 QDate& dateBegin,
88 QDate& dateEnd);
89
90 static void parseWeightedValue(const std::string& weightedValueStr,
91 std::string& value,
92 float& score);
93};
94
95} // namespace DocumentsReader
96} // namespace Lima
97
98#endif
Partie d'un document structure decodee avant analyse.
void popDiscardableElement(unsigned int parserOffset)
void setDataToPreviousElement(StructuredXmlDocumentHandler *processor)
static void parseDate(const std::string &dateStr, QDate &dateBegin, QDate &dateEnd)
void addPart(const Lima::LimaString &text, const unsigned int offset)
Ajoute un couple (texte,offset) au dernier element.
IndexingDocumentElement * pushIndexingChild(const QString &elementName, unsigned int parserOffset, const DocumentPropertyType &propType)
void popIgnoredElement(unsigned int parserOffset)
void popIndexingElement(unsigned int parserOffset)
void setDataToElement(AbstractStructuredDocumentElement *absElement, const DocumentPropertyType &property, const std::string &data, StructuredXmlDocumentHandler *processor)
void popHierarchyElement(unsigned int parserOffset)
PresentationDocumentElement * pushPresentationChild(const QString &elementName, unsigned int parserOffset)
Ajoute un element a la pile de type presentation.
DocumentPropertyElement * addPropertyChild(const QString &elementName, unsigned int parserOffset, const DocumentPropertyType &type)
Ajoute un element a la pile de type propriete du noeud fils.
DiscardableDocumentElement * pushDiscardableChild(const QString &elementName, unsigned int parserOffset)
Ajoute un element a la pile de type noeud discardable.
static void parseWeightedValue(const std::string &weightedValueStr, std::string &value, float &score)
unsigned int getOffset()
retourne la position courante byte du dernier element, pour initialiser le suivant
IgnoredDocumentElement * pushIgnoredChild(const QString &elementName, unsigned int parserOffset, const DocumentPropertyType &propType)
void setDataToLastElement(const DocumentPropertyType &property, const std::string &data, StructuredXmlDocumentHandler *processor)
void popPresentationElement(unsigned int parserOffset)
HierarchyDocumentElement * pushHierarchyChild(const QString &elementName, unsigned int parserOffset, const DocumentPropertyType &propType)
Ajoute un element a la pile de type hierarchy.
void popPropertyElement(unsigned int parserOffset)
Element d'un document Xml discardable Exemple <USELESS>private comment</USELESS> => " ...
Element d'un document XML definissant une propriete du noeud pere Exemple <filename>d1....
Element d'un document XML dont content est indexee Exemple <section lang="fre">yeah</section> Il peut...
Element d'un document XML de presentation Exemple <BOLD>important</BOLD> => " important " ...
Handler pour les elements de parsing de document structure.
NAUTITIA.
QString LimaString
Definition LimaString.h:33
STL namespace.