Overview
| Comment: | [fr] gendicfr.py: don’t include date in affixes file -> deterministic build |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk | fr |
| Files: | files | file ages | folders |
| SHA3-256: |
de4afcc57ad7ba384f0ca66c8f2f4c94 |
| User & Date: | olr on 2020-05-31 08:02:38 |
| Other Links: | manifest | tags |
Context
|
2020-05-31
| ||
| 08:38 | [fr] reconstruction des dictionnaires check-in: b96893d572 user: olr tags: trunk, fr, v1.10.0 | |
| 08:02 | [fr] gendicfr.py: don’t include date in affixes file -> deterministic build check-in: de4afcc57a user: olr tags: trunk, fr | |
| 07:57 | [fr] gendicfr.py: rename packages check-in: 22198f1f33 user: olr tags: trunk, fr | |
Changes
Modified gc_lang/fr/dictionnaire/genfrdic.py from [376f07c785] to [877bd56310].
1 2 3 4 5 6 7 8 9 | #!python3 __author__ = "Olivier R." __license__ = "MPL 2" import os import sys | < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #!python3 __author__ = "Olivier R." __license__ = "MPL 2" import os import sys import re import collections import zipfile import math import argparse from enum import Enum |
| ︙ | ︙ | |||
302 303 304 305 306 307 308 |
"Écrire le fichier des affixes (.aff)"
echo(' * Dictionnaire >> [ {}.aff ]'.format(dTplVars['asciiName']))
info = "# This Source Code Form is subject to the terms of the Mozilla Public\n" + \
"# License, v. 2.0. If a copy of the MPL was not distributed with this\n" + \
"# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\n" + \
"# AFFIXES DU {} v{}\n".format(dTplVars['name'], self.sVersion) + \
"# par Olivier R. -- licence MPL 2.0\n" + \
| < | 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
"Écrire le fichier des affixes (.aff)"
echo(' * Dictionnaire >> [ {}.aff ]'.format(dTplVars['asciiName']))
info = "# This Source Code Form is subject to the terms of the Mozilla Public\n" + \
"# License, v. 2.0. If a copy of the MPL was not distributed with this\n" + \
"# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\n" + \
"# AFFIXES DU {} v{}\n".format(dTplVars['name'], self.sVersion) + \
"# par Olivier R. -- licence MPL 2.0\n" + \
"# Pour améliorer le dictionnaire, allez sur https://grammalecte.net/\n\n"
with open(spDst+'/'+dTplVars['asciiName']+'.aff', 'w', encoding='utf-8', newline="\n") as hDst:
hDst.write(info)
hDst.write(self.sSettings + "\n")
if self.bShortenTags:
hDst.write("AM {}\n".format(len(self.dAM)))
|
| ︙ | ︙ | |||
503 504 505 506 507 508 509 |
hDst.write(str(dRefW[key]))
hDst.write("\n")
def writeLexicon (self, spfDst, version, oStatsLex):
echo(' * Lexique >> [ {} ] '.format(spfDst))
with open(spfDst, 'w', encoding='utf-8', newline="\n") as hDst:
hDst.write(MPLHEADER)
| | | 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 |
hDst.write(str(dRefW[key]))
hDst.write("\n")
def writeLexicon (self, spfDst, version, oStatsLex):
echo(' * Lexique >> [ {} ] '.format(spfDst))
with open(spfDst, 'w', encoding='utf-8', newline="\n") as hDst:
hDst.write(MPLHEADER)
hDst.write("# Lexique des formes fléchies du français - Grammalecte v{}\n# Licence : MPL v2.0\n\n".format(version))
hDst.write(oStatsLex.getInfo())
hDst.write(Flexion.header(oStatsLex))
for oFlex in self.lFlexions:
hDst.write(oFlex.__str__(oStatsLex))
def writeGrammarCheckerLexicon (self, spfDst, version):
echo(' * Lexique simplifié >> [ {} ] '.format(spfDst))
|
| ︙ | ︙ | |||
603 604 605 606 607 608 609 |
hDiff.write("{0.iD}\t{0.fq}\n".format(oEntry))
hNotes.write("{0.lemma}/{0.flags}\t{0.oldFq} > {0.fq}\n".format(oEntry))
def createLexiconPackages (self, spBuild, version, oStatsLex, spDestGL=""):
sLexName = LEX_PREFIX + version
spLex = spBuild + '/' + sLexName
dir_util.mkpath(spLex)
| | | 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 |
hDiff.write("{0.iD}\t{0.fq}\n".format(oEntry))
hNotes.write("{0.lemma}/{0.flags}\t{0.oldFq} > {0.fq}\n".format(oEntry))
def createLexiconPackages (self, spBuild, version, oStatsLex, spDestGL=""):
sLexName = LEX_PREFIX + version
spLex = spBuild + '/' + sLexName
dir_util.mkpath(spLex)
# write lexicon
self.sortLexiconByFreq()
self.writeLexicon(spLex + '/' + sLexName + '.txt', version, oStatsLex)
self.writeGrammarCheckerLexicon(spBuild + '/' + sLexName + '.lex', version)
copyTemplate('lexique', spLex, 'README_lexique.txt', {'version': version})
# zip
createZipFiles(spLex, spBuild, sLexName + '.zip')
# copy GC lexicon to Grammalecte
|
| ︙ | ︙ |