morfeusz_python.i
1023 Bytes
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
%pythoncode %{
def _analyse(self, text):
res = InterpsVector()
_morfeusz2.Morfeusz_analyse(self, text.encode('utf8'), res)
return list(res)
Morfeusz.analyse = _analyse
def _generate(self, text):
res = InterpsVector()
_morfeusz2.Morfeusz_generate(self, text.encode('utf8'), res)
return list(res)
Morfeusz.generate = _generate
def _getOrth(self):
return _morfeusz2.MorphInterpretation_getOrth(self).decode('utf8')
def _getLemma(self):
return _morfeusz2.MorphInterpretation_getLemma(self).decode('utf8')
def _getTag(self):
return _morfeusz2.MorphInterpretation_getTag(self).decode('utf8')
def _getName(self):
return _morfeusz2.MorphInterpretation_getName(self).decode('utf8')
MorphInterpretation.getOrth = _getOrth
MorphInterpretation.getLemma = _getLemma
MorphInterpretation.getTag = _getTag
MorphInterpretation.getName = _getName
%}
%include "std_vector.i"
%include "std_string.i"
%include "std_list.i"
%include "std_set.i"
%include "std_except.i"
%include "exception.i"
%include "typemaps.i"