14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
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")
oDic = IBDAWG(sDicName + ".bdic")
oDic.writeAsJSObject("grammalecte-js/_dictionaries/" + sDicName + ".json")
def main ():
xParser = argparse.ArgumentParser()
xParser.add_argument("src_lexicon", type=str, help="path and file name of the source lexicon")
xParser.add_argument("lang_name", type=str, help="language name")
xParser.add_argument("dic_name", type=str, help="dictionary file name (without extension)")
|
|
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
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")
oDic = IBDAWG(sDicName + ".bdic")
oDic.writeAsJSObject("grammalecte-js/_dictionaries/" + sDicName + ".json", bBinaryDictAsHexString=True)
def main ():
xParser = argparse.ArgumentParser()
xParser.add_argument("src_lexicon", type=str, help="path and file name of the source lexicon")
xParser.add_argument("lang_name", type=str, help="language name")
xParser.add_argument("dic_name", type=str, help="dictionary file name (without extension)")
|