LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
lexiconIdAccessor.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 * Copyright (C) 2003 by CEA *
8 * author Olivier MESNARD olivier.mesnard@cea.fr *
9 * *
10 * lexiconIdAccessor.h - description *
11 * LexiconIdAccessor = base class for concrete IdGenerator *
12 * implements
13 * handle composed word and rely on concrete
14 * based on FsaAccesSpare16 for simple words and *
15 * std::map<pair<id1,id2>,id3> for compounds. *
16 ***************************************************************************/
17#ifndef LEXICON_ID_ACCESSOR_H
18#define LEXICON_ID_ACCESSOR_H
19
22// #include "AbstractFsaAccessIStreamWrapper.h"
24
25#include "common/LimaCommon.h"
26namespace Lima {
27namespace Common {
28namespace FsaAccess {
29
30typedef std::vector<DepCompoundLink> DepCompoundLinksV;
31typedef std::vector<ExtCompoundLink> ExtCompoundLinksV;
32
33class CompoundsDataIterator;
34
35template<typename SimpleStringAccess>
37{
39 public:
41 virtual ~LexiconIdAccessor() {}
42
43 // implementation of operation inherited from interface AbstractLexiconIdAccessor
44 uint64_t getId(const LimaString& word) override;
45 uint64_t getId(const std::vector<uint64_t>& structure) override;
46// CompoundsDataIterator getDataIterator();
48// void read(AbstractFsaAccessIStreamWrapper& handler);
50 void feedWithNextDepData(const char* buff, uint64_t );
51 void feedWithNextExtData(const char* buff, uint64_t );
53 uint64_t getSize() const override;
54 uint64_t getSimpleTermSize() const override;
55 void print(std::ostream& os) const;
56
57 private:
58 SimpleStringAccess m_simpleWords;
59 DepCompoundLinksV m_depCompoundLinks;
60 ExtCompoundLinksV m_extCompoundLinks;
61 // for getNextDepData() and getNextExtData() operation
62 ExtCompoundLinksV::const_iterator m_extIt;
63 DepCompoundLinksV::const_iterator m_depIt;
64 static const uint64_t BUFFER_SIZE;
65};
66
67/*
68template<typename SimpleStringAccess, typename ForwardIDepter>
69class CompoundsDataIterator {
70 public:
71 CompoundsDataIterator( typename LexiconIdAccessor<SimpleStringAccess>& accessor );
72 private:
73 uint8_t* m_data;
74 LexiconIdAccessor<SimpleStringAccess>& m_accessor;
75 ForwardDepIter
76};
77*/
78
79
80} // namespace FsaAccess
81} // namespace Common
82} // namespace Lima
83#include "lexiconIdAccessor.tcc"
84
85#endif //FSA_LEXICON_ID_ACCESSOR_H
#define BUFFER_SIZE
uint64_t getId(const LimaString &word) override
uint64_t getId(const std::vector< uint64_t > &structure) override
void feedWithNextDepData(const char *buff, uint64_t)
void read(FsaAccessDataInputHandler &handler)
uint64_t getSimpleTermSize() const override
void feedWithNextExtData(const char *buff, uint64_t)
void print(std::ostream &os) const
std::vector< DepCompoundLink > DepCompoundLinksV
std::vector< ExtCompoundLink > ExtCompoundLinksV
NAUTITIA.
QString LimaString
Definition LimaString.h:33