LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
XmlSyntagmaticMatrixFileHandler.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
17#ifndef XMLSYNTAGMATICMATRIXFILEHANDLER_H
18#define XMLSYNTAGMATICMATRIXFILEHANDLER_H
19
21#include "SyntagmaticMatrix.h"
22#include "TokenFilter.h"
25
26#include <QtXml/QXmlDefaultHandler>
27
28#include <string>
29
30
31namespace Lima {
32namespace LinguisticProcessing {
33namespace SyntacticAnalysis {
34
40{
41public:
42 // -----------------------------------------------------------------------
43 // Constructors
44 // -----------------------------------------------------------------------
45 XMLSyntagmaticMatrixFileHandler(SyntagmDefStruct& theMatrices,MediaId language);
47
48
49 // -----------------------------------------------------------------------
50 // Implementations of the SAX DocumentHandler interface
51 // -----------------------------------------------------------------------
52 bool endElement(const QString & namespaceURI,
53 const QString & name,
54 const QString & qName) override;
55
56 bool characters(const QString& chars) override;
57
58 bool startElement(const QString & namespaceURI,
59 const QString & name,
60 const QString & qName,
61 const QXmlAttributes & attributes) override;
62
63 // -----------------------------------------------------------------------
64 // Implementations of the SAX ErrorHandler interface
65 // -----------------------------------------------------------------------
66 bool warning(const QXmlParseException & exception) override;
67 bool error(const QXmlParseException & exception) override;
68 bool fatalError(const QXmlParseException & exception) override;
69
70private:
74 SyntagmDefStruct& m_matrices;
75
77 std::map< Common::MediaticData::ChainsType, std::map< std::string, TokenFilter > > m_tokenFilters;
78
79 std::string m_currentElement;
80 std::string m_currentFilterId;
81 std::string m_currentFilterName;
82 std::set< StringsPoolIndex > m_currentFilterAttributes;
83 std::set< LinguisticCode > m_currentFilterCategories;
84 Common::MediaticData::ChainsType m_currentChainType;
85 Common::MediaticData::ChainsType m_currentMatrixType;
86 std::string m_currentMatrixLineId;
87 MediaId m_language;
88};
89
90} // closing namespace SyntacticAnalysis
91} // closing namespace LinguisticProcessing
92} // closing namespace Lima
93
94#endif
A graph structure for linguistic analysis.
#define LIMA_SYNTACTICANALYSIS_EXPORT
ChainsType
syntactic chains type
NAUTITIA.