1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#!python3
# Lexicon builder
from distutils import dir_util
import grammalecte.dawg as fsa
from grammalecte.ibdawg import IBDAWG
def build (spfSrc, sLangName, sDicName, cStemmingMethod, nCompressMethod, bJSON=False):
"transform a text lexicon as a binary indexable dictionary"
oDAWG = fsa.DAWG(spfSrc, sLangName, cStemmingMethod)
dir_util.mkpath("grammalecte/_dictionaries")
oDAWG.writeInfo("grammalecte/_dictionaries/" + sDicName + ".info.txt")
oDAWG.createBinary("grammalecte/_dictionaries/" + sDicName + ".bdic", int(nCompressMethod))
if bJSON:
dir_util.mkpath("grammalecte-js/_dictionaries")
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#!python3
# Lexicon builder
from distutils import dir_util
import grammalecte.dawg as fsa
from grammalecte.ibdawg import IBDAWG
def build (spfSrc, sLangName, sDicName, bJSON=False, cStemmingMethod="S", nCompressMethod=1):
"transform a text lexicon as a binary indexable dictionary"
oDAWG = fsa.DAWG(spfSrc, sLangName, cStemmingMethod)
dir_util.mkpath("grammalecte/_dictionaries")
oDAWG.writeInfo("grammalecte/_dictionaries/" + sDicName + ".info.txt")
oDAWG.createBinary("grammalecte/_dictionaries/" + sDicName + ".bdic", int(nCompressMethod))
if bJSON:
dir_util.mkpath("grammalecte-js/_dictionaries")
|