LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
DictionaryData.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) 2004-2012 by CEA LIST *
8 * *
9 ***************************************************************************/
10#ifndef LIMA_LINGUISTICPROCESSING_ANALYSISDICTDICTIONARYDATA_H
11#define LIMA_LINGUISTICPROCESSING_ANALYSISDICTDICTIONARYDATA_H
12
13#include "AnalysisDictExport.h"
14#include <string>
15#include <vector>
16
17#define UNIT_TEST
18
19class DictionaryDataTest1;
20
21namespace Lima
22{
23
24namespace LinguisticProcessing
25{
26
27namespace AnalysisDict
28{
29
34{
35#ifdef UNIT_TEST
36 friend class ::DictionaryDataTest1; // to test private operation in DictionaryData
37#endif
38public:
40
41 virtual ~DictionaryData();
42
43 void loadBinaryFile(const std::string& file);
44
45 inline unsigned char* getEntryAddr(uint64_t index) const;
46 inline unsigned char* getLingPropertiesAddr(uint64_t index) const;
47
48 uint64_t getSize() const;
49
50 static uint64_t readCodedInt(unsigned char* &p);
51
52private:
53
54 unsigned char* m_data;
55 std::vector<unsigned char*> m_entriesAddr;
56 std::vector<unsigned char*> m_lingPropertiesAddr;
57
58};
59
60inline unsigned char* DictionaryData::getEntryAddr(uint64_t index) const
61{
62 return m_entriesAddr.at(index);
63}
64
65inline unsigned char* DictionaryData::getLingPropertiesAddr(uint64_t index) const
66{
67 return m_lingPropertiesAddr.at(index);
68}
69
70inline uint64_t DictionaryData::getSize() const
71{
72 return m_entriesAddr.size();
73}
74
75
76}
77
78}
79
80}
81
82#endif
#define LIMA_ANALYSISDICT_EXPORT
unsigned char * getLingPropertiesAddr(uint64_t index) const
unsigned char * getEntryAddr(uint64_t index) const
NAUTITIA.