add scripts. rename NlpCodec. update documents

This commit is contained in:
2023-07-13 22:12:02 +08:00
parent 7078341556
commit 150466966b
11 changed files with 86 additions and 26 deletions

View File

@ -4,7 +4,7 @@ import collections
if NlpUtils.g_EnableDebugging:
g_SupportedEncoding = {
'template': ('English', ('ascii', ), )
'template': ('English', ('windows-1252', ), )
}
else:
g_SupportedEncoding = {
@ -36,12 +36,12 @@ if __name__ == "__main__":
preLoadedData[ver] = PreLoadedDiffIdxTuple._make((insertedKey, deletedKey, plainKeys))
# iterate lang first
# because we use progressive patch. we need iterate vt ver in order
# because we use progressive patch. we need iterate vt ver in order for each single languages
for lang in NlpUtils.g_SupportedLangs:
prevPlainValues: list[str] = None
for ver in NlpUtils.g_VirtoolsVersion:
print(f'Processing {ver}.{lang}...')
print(f'Loading {ver}.{lang}...')
# pick data from pre-loaded dict
diffIdxData = preLoadedData[ver]

View File

@ -4,7 +4,7 @@ import io
import json
import re
g_EnableDebugging = True
g_EnableDebugging = False
g_VirtoolsVersion: tuple[str] = (
'25', '35', '40', '50',

View File

@ -4,3 +4,5 @@ Example:
Create templates: `py NlpJsonDecoder.py`
Compile translations: `py NlpJsonEncoder.py`
NOTE: all python files should be executed in this folder. NOT ROOT folder.