LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
transitionSearchStructure.h
Go to the documentation of this file.
1// Copyright 2002-2018 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/************************************************************************
7 *
8 * @file transitionSearchStructure.h
9 * @author besancon (besanconr@zoe.cea.fr)
10 * @date Mon Oct 11 2004
11 * copyright Copyright (C) 2004 by CEA LIST
12 * Project Automaton
13 *
14 * @brief this class contains a structure designed to optimize
15 * the search for matching transition units with a vertex
16 * in analysis graph
17 *
18 *
19 ***********************************************************************/
20
21#ifndef TRANSITIONSEARCHSTRUCTURE_H
22#define TRANSITIONSEARCHSTRUCTURE_H
23
24#include "transitionUnit.h"
25#include "automatonCommon.h"
26#include <queue>
27
28namespace Lima {
29namespace LinguisticProcessing {
30namespace Automaton {
31
32// TargetType will be Transition (in automaton)
33// or TriggerRule (in recognizer) : both have
34// access to matching TransitionUnit and to result
35// type
36template <typename TargetType>
38{
39 public:
42
43 void init(const std::vector<TargetType>& l,
44 const Common::PropertyCode::PropertyAccessor* macroAccessor,
45 const Common::PropertyCode::PropertyAccessor* microAccessor);
46 void clear();
47 void clearMaps();
48 bool empty() const;
49
50 uint64_t
52 const LinguisticGraphVertex& vertex,
53 AnalysisContent& analysis,
56 std::vector<const TargetType*>& matchingSetOfRules) const;
57 uint64_t
59 const LinguisticGraphVertex& vertex,
60 const LinguisticGraphVertex& limit,
61 const SearchGraph* searchGraph,
62 AnalysisContent& analysis,
65 std::vector<std::pair<std::deque<LinguisticGraphVertex>,const TargetType*> >& matchingSetOfRules) const;
66
67 // for debug only
68 void printStructure(std::ostream& os) const;
69
70 private:
71 typedef std::multimap<Tword,const TargetType*> WordMap;
72 typedef std::multimap<Tpos,const TargetType*> PosMap;
73 typedef std::multimap<std::pair<Tword,Tpos>,const TargetType*> LemmaMap;
74 typedef std::multimap<LinguisticAnalysisStructure::TStatus,const TargetType*> TstatusMap;
75 typedef std::vector<std::pair<TransitionUnit*,const TargetType*> > TransitionList;
76
77 WordMap m_wordMap;
78 PosMap m_posMap;
79 LemmaMap m_lemmaMap;
80 TstatusMap m_tstatusMap;
81 TransitionList m_otherTransitions;
82
83 // static members for access of macro and macro_micro
84 // const Common::PropertyCode::PropertyAccessor* m_macroAccessor;
85 // const Common::PropertyCode::PropertyAccessor* m_microAccessor;
86};
87
88} // end namespace
89} // end namespace
90} // end namespace
91
92#include "transitionSearchStructure.tcc"
93
94#endif
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
Provide function to read write and check a property.
void init(const std::vector< TargetType > &l, const Common::PropertyCode::PropertyAccessor *macroAccessor, const Common::PropertyCode::PropertyAccessor *microAccessor)
uint64_t findMatchingTransitions(const LinguisticAnalysisStructure::AnalysisGraph &graph, const LinguisticGraphVertex &vertex, AnalysisContent &analysis, const LinguisticAnalysisStructure::Token *token, const LinguisticAnalysisStructure::MorphoSyntacticData *data, std::vector< const TargetType * > &matchingSetOfRules) const
uint64_t findMatchingTransitions2(const LinguisticAnalysisStructure::AnalysisGraph &graph, const LinguisticGraphVertex &vertex, const LinguisticGraphVertex &limit, const SearchGraph *searchGraph, AnalysisContent &analysis, const LinguisticAnalysisStructure::Token *token, const LinguisticAnalysisStructure::MorphoSyntacticData *data, std::vector< std::pair< std::deque< LinguisticGraphVertex >, const TargetType * > > &matchingSetOfRules) const
An AnalysisData containing a LinguisticGraph with a language and an id.
NAUTITIA.