LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
FsaAccessHeader.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
compactDict.h - description
8
-------------------
9
begin : mer mai 28 2003
10
copyright : (C) 2003 by Olivier Mesnard
11
email : olivier.mesnard@cea.fr
12
***************************************************************************/
13
14
/***************************************************************************
15
* *
16
* Compact dictionnary based on finite state automata implemented with *
17
* Boost Graph library. *
18
* Algorithm is described in article from Daciuk, Mihov, Watson & Watson: *
19
* "Incremental Construction of Minimal Acyclic Finite State Automata" *
20
* How to use it to compute hash code is explained in 'perfect hashing' *
21
* of document http://odur.let.rug.nl/alfa/fsa_stuff/#PerfHash *
22
* *
23
***************************************************************************/
24
25
#ifndef FSA_ACCESS_HEADER_H
26
#define FSA_ACCESS_HEADER_H
27
28
// From standard library
29
#include <string>
30
#include "
common/FsaAccess/FsaExceptions.h
"
31
32
namespace
Lima
{
33
namespace
Common {
34
namespace
FsaAccess {
35
36
enum
char_order_type
{
FORWARD
=0,
REVERSE
=1};
37
enum
dict_packing_type
{
BUILDER
=0,
BUILT
=1,
SPARE
=2} ;
38
39
#define MAGIC_NUMBER "limaFsaDict"
40
#define HEADER_SIZE 1024
41
// we autorize around 100 millions simple terms
42
// higher ids are reserved to identify complex terms (compound words)
43
#define MAX_SIMPLE_TID 100000000
44
45
#define VERTEX_PROPERTY_16 uint64_t
46
#define MAJOR_VERSION_16 2
47
#define MINOR_VERSION_16 0
48
49
class
AbstractFsaAccessIStreamWrapper;
50
class
AbstractFsaAccessOStreamWrapper;
51
52
class
FsaAccessHeaderPrivate;
72
class
LIMA_FSAACCESS_EXPORT
FsaAccessHeader
{
73
public
:
74
FsaAccessHeader
(
bool
trie_direction_fwd);
75
virtual
~FsaAccessHeader
();
76
void
read(
AbstractFsaAccessIStreamWrapper
& iw );
77
void
write(
AbstractFsaAccessOStreamWrapper
& ow);
78
bool
getTrieDirectionForward()
const
;
79
uint64_t getNbVertices()
const
;
80
uint64_t getNbEdges()
const
;
81
void
setPackingStatus(uint8_t packingStatus);
82
void
setNbVertices(uint64_t nbVerts);
83
void
setNbEdges(uint64_t nbEdges);
84
// uint64_t getMaxSimpleId() const;
85
// uint64_t int getCompoundsDataOffset();
86
// uint64_t getNbCompounds() const;
87
// void setStreamPos(std::ifstream& is);
88
// const long& getStreamPos();
89
protected
:
90
FsaAccessHeader
(
const
FsaAccessHeader
& h);
91
FsaAccessHeader
& operator=(
const
FsaAccessHeader
& h);
92
FsaAccessHeaderPrivate
*
m_d
;
93
};
94
95
}
// namespace FsaAccess
96
}
// namespace Common
97
}
// namespace Lima
98
99
#endif
//FSA_ACCESS_HEADER_H
FsaExceptions.h
LIMA_FSAACCESS_EXPORT
#define LIMA_FSAACCESS_EXPORT
Definition
LimaCommon.h:130
Lima::Common::FsaAccess::AbstractFsaAccessIStreamWrapper
Definition
FsaAccessIOStreamWrapper.h:24
Lima::Common::FsaAccess::AbstractFsaAccessOStreamWrapper
Definition
FsaAccessIOStreamWrapper.h:31
Lima::Common::FsaAccess::FsaAccessHeaderPrivate
Definition
FsaAccessHeader.cpp:34
Lima::Common::FsaAccess::FsaAccessHeader
FsaDictionaries (FsaDictBuilder and FsaDictSpare) share the same binary file format:
Definition
FsaAccessHeader.h:72
Lima::Common::FsaAccess::FsaAccessHeader::m_d
FsaAccessHeaderPrivate * m_d
Definition
FsaAccessHeader.h:92
Lima::Common::FsaAccess::char_order_type
char_order_type
Definition
FsaAccessHeader.h:36
Lima::Common::FsaAccess::REVERSE
@ REVERSE
Definition
FsaAccessHeader.h:36
Lima::Common::FsaAccess::FORWARD
@ FORWARD
Definition
FsaAccessHeader.h:36
Lima::Common::FsaAccess::dict_packing_type
dict_packing_type
Definition
FsaAccessHeader.h:37
Lima::Common::FsaAccess::BUILT
@ BUILT
Definition
FsaAccessHeader.h:37
Lima::Common::FsaAccess::BUILDER
@ BUILDER
Definition
FsaAccessHeader.h:37
Lima::Common::FsaAccess::SPARE
@ SPARE
Definition
FsaAccessHeader.h:37
Lima
NAUTITIA.
Definition
AmosePluginsManager.h:15
lima_common
src
common
FsaAccess
FsaAccessHeader.h
Generated by
1.9.8