LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
SimpleDataDico.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_SIMPLEDDICO_SIMPLEDDICO_HPP
13#define COMMON_SIMPLEDDICO_SIMPLEDDICO_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 : frequency dictionary
40//typedef FsaAccessSpare16 accessMethod;
41//typedef int contentElement;
42//typedef std::vector<int> storedSet;
43
44template <typename accessMethod, typename contentElement, typename storedSet>
45class SimpleDataDico : public StringMap<accessMethod, contentElement> {
46public:
47 SimpleDataDico(const contentElement& defaultValue );
48 void parseData( const std::string& dataFileName );
49 const contentElement& getElement(const Lima::LimaString& word) const;
50/*
51 std::pair<ComposedDict16_subword_iterator, ComposedDict16_subword_iterator>
52 getSubWordEntries(
53 const Lima::uint64_t offset,
54 const Lima::LimaString& key ) const;
55*/
56protected:
57 // set of data associated to entries
58 storedSet m_data;
59};
60
61} // namespace StringMap
62} // namespace Commmon
63} // namespace Lima
64
65#include "common/StringMap/SimpleDataDico.tcc"
66
67#endif //COMMON_SIMPLEDDICO_SIMPLEDDICO_HPP
void parseData(const std::string &dataFileName)
SimpleDataDico(const contentElement &defaultValue)
const contentElement & getElement(const Lima::LimaString &word) const
NAUTITIA.
QString LimaString
Definition LimaString.h:33