Index: gc_lang/fr/dictionnaire/genfrdic.py ================================================================== --- gc_lang/fr/dictionnaire/genfrdic.py +++ gc_lang/fr/dictionnaire/genfrdic.py @@ -296,17 +296,17 @@ def writeDictionary (self, spDst, dTplVars, nMode, bSimplified): "Écrire le fichier dictionnaire (.dic)" echo(' * Dictionnaire >> [ {}.dic ] ({})'.format(dTplVars['asciiName'], dTplVars['subDicts'])) nEntry = 0 for oEntry in self.lEntry: - if oEntry.di in dTplVars['subDicts']: + if oEntry.di in dTplVars['subDicts'] and " " not in oEntry.lemma: nEntry += 1 with open(spDst+'/'+dTplVars['asciiName']+'.dic', 'w', encoding='utf-8', newline="\n") as hDst: hDst.write(str(nEntry)+"\n") for oEntry in self.lEntry: - if oEntry.di in dTplVars['subDicts']: - hDst.write(oEntry.getEntryLine(self, nMode, bSimplified)) + if oEntry.di in dTplVars['subDicts'] and " " not in oEntry.lemma: + hDst.write(oEntry.getHunspellLine(self, nMode, bSimplified)) def writeAffixes (self, spDst, dTplVars, nMode, bSimplified): "É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" + \ @@ -865,11 +865,11 @@ return (self.lemma.translate(CHARMAP), self.flags, self.po) def keyTriNum (self): return (self.lemma, self.flags, self.po) - def getEntryLine (self, oDict, nMode, bSimplified=False): + def getHunspellLine (self, oDict, nMode, bSimplified=False): sLine = self.lemma.replace("’", "'") if self.flags: sLine += '/' sLine += self.flags if not oDict.bShortenTags or bSimplified else oDict.dAF[self.flags] if bSimplified: @@ -1499,11 +1499,10 @@ hDst.write("{} - {}\n".format(e[0], e[1])) def main (): - xParser = argparse.ArgumentParser() xParser.add_argument("-v", "--verdic", help="set dictionary version, i.e. 5.4", type=str, default="X.Y.z") xParser.add_argument("-m", "--mode", help="0: no tags, 1: Hunspell tags (default), 2: All tags", type=int, choices=[0, 1, 2], default=1) xParser.add_argument("-u", "--uncompress", help="do not use Hunspell compression", action="store_true") xParser.add_argument("-s", "--simplify", help="no virtual lemmas", action="store_true")