| Comment: | [fr][build][fx] split the thesaurus in two parts to bypass AMO, then merge them after loading |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk | fr | build | fx |
| Files: | files | file ages | folders |
| SHA3-256: |
6e729d98df7a790c0e3f1437892f0ac3 |
| User & Date: | olr on 2025-12-15 14:53:24 |
| Other Links: | manifest | tags |
|
2025-12-15
| ||
| 17:15 | [fx] intitulé pour le lancement du Thesaurus check-in: aae1c5282e user: olr tags: trunk, fx | |
| 14:53 | [fr][build][fx] split the thesaurus in two parts to bypass AMO, then merge them after loading check-in: 6e729d98df user: olr tags: trunk, fr, build, fx | |
| 10:47 | [fr][build] fix thesaurus build check-in: cc5f0a602d user: olr tags: trunk, fr, build | |
Modified gc_lang/fr/build_data.py from [a24db6ede9] to [4e92c3f4f5].
| ︙ | |||
54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | + + - - - - - - - - - - - - - - + - |
try:
oDict = ibdawg.IBDAWG("fr-allvars.json")
except:
traceback.print_exc()
def makeDictionaries (sp, sVersion):
print("> Exécution du script dans gc_lang/fr/dictionnaire:")
print(" genfrdic.py -s -gl -v "+sVersion)
with cd(sp+"/dictionnaire"):
if platform.system() == "Windows":
os.system("python genfrdic.py -s -gl -v "+sVersion)
else:
os.system("python3 ./genfrdic.py -s -gl -v "+sVersion)
|
| ︙ | |||
206 207 208 209 210 211 212 | 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | - + - |
hDst.write(' "dPatternConj": ' + json.dumps(dPatternList, ensure_ascii=False) + ",\n")
hDst.write(' "dVerb": ' + json.dumps(dVerb, ensure_ascii=False) + ",\n")
hDst.write(' "dVerbNames": ' + json.dumps(dVerbNames, ensure_ascii=False) + "\n")
hDst.write("}\n")
def makeMfsp (sp, bJS=False):
|
| ︙ | |||
295 296 297 298 299 300 301 | 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | - + - |
' "lTagFemForm": ' + json.dumps(lTagFemForm, ensure_ascii=False) + ",\n" + \
' "dMiscPlur": ' + json.dumps(dMiscPlur, ensure_ascii=False) + ",\n" + \
' "dMasForm": ' + json.dumps(dMasForm, ensure_ascii=False) + "\n}"
open(sp+"/modules-js/mfsp_data.json", "w", encoding="utf-8", newline="\n").write(sCode)
def makePhonetTable (sp, bJS=False):
|
| ︙ | |||
354 355 356 357 358 359 360 361 362 | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | + + + + + + + + + + + + + + + + + + + + + + - + - + - + + - + |
## write file for JavaScript
sCode = "{\n" + \
' "dWord": ' + json.dumps(dWord, ensure_ascii=False) + ",\n" + \
' "lSet": ' + json.dumps(lSet, ensure_ascii=False) + ",\n" + \
' "dMorph": ' + json.dumps(dMorph, ensure_ascii=False) + "\n}"
open(sp+"/modules-js/phonet_data.json", "w", encoding="utf-8", newline="\n").write(sCode)
def makeThesaurusFiles (sp, bJS=False):
print("> Fichiers du Thésaurus pour Grammalecte")
dThesaurus = {}
sContent = open(sp+'/data/thes_fr.json', "r", encoding="utf-8").read()
dThesaurus = json.loads(sContent)
## write file for Python
sCode = "# generated data (do not edit)\n\n" + \
"dThesaurus = " + str(dThesaurus) + "\n"
open(sp+"/modules/thesaurus_data.py", "w", encoding="utf-8", newline="\n").write(sCode)
if bJS:
## write file for JavaScript
#shutil.copy2(sp+'/data/thes_fr.json', sp+"/modules-js/thesaurus_data.json")
# thes_fr.json is too big, we have to split it.
# Addons.mozilla.org doesn’t a file that big. 5 Mo maximum.
nHalfSize = len(dThesaurus) // 2
dThes1 = { k: v for i, (k, v) in enumerate(dThesaurus.items()) if i < nHalfSize }
dThes2 = { k: v for i, (k, v) in enumerate(dThesaurus.items()) if i >= nHalfSize }
open(sp+"/modules-js/thesaurus1_data.json", "w", encoding="utf-8").write(json.dumps(dThes1, ensure_ascii=False))
open(sp+"/modules-js/thesaurus2_data.json", "w", encoding="utf-8").write(json.dumps(dThes2, ensure_ascii=False))
def before (spLaunch, dVars, bJS=False):
|
Modified gc_lang/fr/modules-js/conj_data.json from [a2e2224de3] to [6ea791c67f].
cannot compute difference between binary files
Modified gc_lang/fr/modules-js/phonet_data.json from [b44369a83a] to [eaf6532f4d].
cannot compute difference between binary files
Modified gc_lang/fr/modules-js/thesaurus.js from [009b56b2e7] to [ea28bf31d8].
| ︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | - + + + - + + + + |
}
var thesaurus = {
_dWord: new Map(),
bInit: false,
|
| ︙ | |||
49 50 51 52 53 54 55 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | - + - + - + |
};
// Initialization
if (!thesaurus.bInit && typeof(process) !== 'undefined') {
// NodeJS
|
Added gc_lang/fr/modules-js/thesaurus1_data.json version [89efb4ec45].
cannot compute difference between binary files
Added gc_lang/fr/modules-js/thesaurus2_data.json version [91477a6b41].
cannot compute difference between binary files
Deleted gc_lang/fr/modules-js/thesaurus_data.json version [98eda155ed].
cannot compute difference between binary files
Modified gc_lang/fr/modules/conj_data.py from [98e2c62b97] to [69e6366454].
cannot compute difference between binary files
Modified gc_lang/fr/modules/phonet_data.py from [db27fd047c] to [4a78ac706b].
cannot compute difference between binary files
Modified gc_lang/fr/webext/gce_worker.js from [946a071330] to [94be7196a8].
| ︙ | |||
174 175 176 177 178 179 180 | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | - + |
function init (sExtensionPath, dOptions=null, sContext="JavaScript", oInfo={}) {
try {
if (!bInitDone) {
//console.log("[Worker] Loading… Extension path: " + sExtensionPath);
conj.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/conj_data.json"));
phonet.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/phonet_data.json"));
mfsp.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/mfsp_data.json"));
|
| ︙ |
Modified make.py from [78c9ddad51] to [0e97d75023].
| ︙ | |||
174 175 176 177 178 179 180 | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | - + |
for sf in os.listdir(spLangPack):
if not os.path.isdir(spLangPack+"/"+sf):
hZip.write(spLangPack+"/"+sf, sAddPath+spLangPack+"/"+sf)
def create (sLang, xConfig, bInstallOXT, bJavaScript, bUseCache):
"make Grammalecte for project <sLang>"
|
| ︙ | |||
279 280 281 282 283 284 285 | 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | - + - + |
buildjs.build(sLang, dVars)
return dVars['version']
def copyGraphspellCore (bJavaScript=False):
"copy Graphspell package in Grammalecte package"
|
| ︙ | |||
411 412 413 414 415 416 417 | 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | - + |
xParser.add_argument("-l", "--lint_web_ext", help="web-ext lint on the WebExtension", action="store_true")
xParser.add_argument("-tb", "--thunderbird", help="Launch Thunderbird", action="store_true")
xParser.add_argument("-tbb", "--thunderbird_beta", help="Launch Thunderbird Beta", action="store_true")
xParser.add_argument("-i", "--install", help="install the extension in Writer (path of unopkg must be set in config.ini)", action="store_true")
xArgs = xParser.parse_args()
oNow = datetime.datetime.now()
|
| ︙ |