Debian Codegraph @

Source/Reasoner/Preprocess/CLexicalNormalisationPreProcess.h

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #ifndef KONCLUDE_REASONER_PREPROCESS_CLEXICALNORMALISATIONPREPROCESS_H
22 #define KONCLUDE_REASONER_PREPROCESS_CLEXICALNORMALISATIONPREPROCESS_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "CConcreteOntologyContinuablePreProcess.h"
29 #include "CConceptUnambiguousHasher.h"
30
31
32 // Other includes
33 #include "Utilities/CHashableIntConvertedNTuble.hpp"
34 #include "Utilities/CMemoryManager.hpp"
35 #include "Utilities/CDynamicExpandingMemoryManager.hpp"
36
37
38 // Logger includes
39 #include "Logger/CLogger.h"
40
41
42
43 namespace Konclude {
44
45 namespace Reasoner {
46
47 namespace Preprocess {
48
49 /*!
50 *
51 * \class CLexicalNormalisationPreProcess
52 * \author Andreas Steigmiller
53 * \version 0.1
54 * \brief Not thread safe
55 *
56 */
57 class CLexicalNormalisationPreProcess : public CConcreteOntologyContinuablePreProcess {
58 // public methods
59 public:
60 //! Constructor
61 CLexicalNormalisationPreProcess();
62
63 //! Destructor
64 virtual ~CLexicalNormalisationPreProcess();
65
66 virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context);
67 virtual CConcreteOntology* continuePreprocessing();
68
69
70 // protected methods
71 protected:
72 void negateOperandConcepts(CConcept *concept, int firstNegationOperand = 0);
73 void addNormalizeConcept(CConcept *concept);
74 void normalizeListedConcepts();
75 void normalizeConcept(CConcept *concept, bool isLocal);
76
77 CConceptUnambiguousHasher getConceptHasher(CConcept *concept);
78 CSortedNegLinker<CConcept*>* resortConceptLinkersByTagging(CSortedNegLinker<CConcept*>* conceptLinkers);
79
80 // private methods
81 private:
82
83 // private variables
84 private:
85 CConcept *topConcept;
86 QHash<CConceptUnambiguousHasher,CConcept*>* replacementHash;
87 QHash< CConcept*,QPair<bool,CConcept*> >* conceptReplaceHash;
88 QSet<CConcept*>* processedSet;
89 QList<CConcept*>* processingList;
90
91 CMemoryAllocationManager* mBoxMemMan;
92
93 CConceptVector *concepts;
94 CRoleVector *roles;
95 CIndividualVector *individuals;
96
97
98 };
99
100 }; // end namespace Preprocess
101
102 }; // end namespace Reasoner
103
104 }; // end namespace Konclude
105
106 #endif // KONCLUDE_REASONER_PREPROCESS_CLEXICALNORMALISATIONPREPROCESS_H