LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
IndirectDataDico.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 * composed dictionnary *
11 ***************************************************************************/
12#ifndef COMMON_STRINGMAP_INDIRECTEDDATADICO_HPP
13#define COMMON_STRINGMAP_INDIRECTEDDATADICO_HPP
14
15
16#include "common/LimaCommon.h"
17
19
20namespace Lima {
21namespace Common {
22namespace StringMap {
23
24/*
25 * typename accessMethod: class with following method:
26 * accessMethod(bool keyOrderingIsForward)
27 * int getIndex(const basic_string<Lima::LimaChar>& key) const;
28 * uint64_t getSize() const;
29 * void read(keyFileName);
30 *
31 * typename contentElement: class or predefined type with following features
32 * copy constructor
33 *
34 * typename storedSet: class with following method:
35 * contentElement operator [] (int);
36 *
37 */
38
39// Example : analysis dictionary
40//typedef FsaAccessSpare16 accessMethod;
41//typedef Lima::LinguisticProcessing::Dictionary::DictionarEntry contentElement;
42//typedef std::vector<uint8_t *> storedSet;
43
44template <typename accessMethod, typename contentElement>
45//class AnalysisDico : public StringMap<accessMethod, contentElement, storedSet> {
46class IndirectDataDico : public StringMap<accessMethod, contentElement> {
47public:
48 IndirectDataDico(const contentElement& defaultValue );
50 void parseData( const std::string& dataFileName );
51 virtual contentElement getEntry(const Lima::LimaString& word) const = 0;
52/*
53 std::pair<ComposedDict16_subword_iterator, ComposedDict16_subword_iterator>
54 getSubWordEntries(
55 const Lima::uint64_t offset,
56 const Lima::LimaString& key ) const;
57*/
58protected:
59 // set of data associated to entries
60 uint64_t *m_index2Data;
61 uint8_t* m_data;
62 virtual void fillIndex2Data();
63};
64
65} // namespace StringMap
66} // namespace Commmon
67} // namespace Lima
68
69#include "common/StringMap/IndirectDataDico.tcc"
70
71#endif //COMMON_STRINGMAP_INDIRECTEDDATADICO_HPP
virtual contentElement getEntry(const Lima::LimaString &word) const =0
IndirectDataDico(const contentElement &defaultValue)
void parseData(const std::string &dataFileName)
NAUTITIA.
QString LimaString
Definition LimaString.h:33