/
pycolibri_classes.pxd
53 lines (43 loc) · 1.47 KB
/
pycolibri_classes.pxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from libcpp.string cimport string
from libcpp.set cimport set as cppset
from libcpp.vector cimport vector
from libcpp cimport bool
from unordered_map cimport unordered_map
from libc.stdint cimport *
#cdef extern from *:
# ctypedef char* const_EncAnyGram "const EncAnyGram"
cdef extern from "ngram.h":
cdef cppclass EncAnyGram:
string decode(ClassDecoder&)
int n()
cdef cppclass EncNGram(EncAnyGram):
pass
cdef extern from "patternmodel.h":
cdef cppclass CorpusReference:
uint8_t token
uint32_t sentence
cdef cppclass AnyGramData:
pass
cdef cppclass NGramData(AnyGramData):
cppset[CorpusReference] refs
int count()
ctypedef vector[const EncAnyGram*] anygramvector
cdef cppclass IndexedPatternModel:
IndexedPatternModel(string, bool, bool) except +
bool exists(EncAnyGram*)
unordered_map[EncNGram,NGramData] ngrams
unordered_map[int, anygramvector] reverse_index
int types()
int tokens()
int occurrencecount(EncAnyGram*) except +
AnyGramData * getdata(EncAnyGram*)
anygramvector get_reverse_index(int i)
cdef extern from "classdecoder.h":
cdef cppclass ClassDecoder:
ClassDecoder(string) except +
int size()
cdef extern from "classencoder.h":
cdef cppclass ClassEncoder:
ClassEncoder(string) except +
int size()
EncAnyGram* input2anygram(string , bool allowunknown, bool autoaddunknown)