예제 #1
0
 def finish(self):
     from pyglossary.os_utils import runDictzip
     self._dictdb.finish(dosort=1)
     if self._dictzip:
         runDictzip(f"{self._filename}.dict")
     if self._install:
         installToDictd(
             self._filename,
             self._dictzip,
             self._glos.getInfo("name").replace(" ", "_"),
         )
     self._filename = None
예제 #2
0
 def write(self) -> "Generator[None, BaseEntry, None]":
     from pyglossary.os_utils import runDictzip
     if self._sametypesequence:
         if self._merge_syns:
             yield from self.writeCompactMergeSyns(self._sametypesequence)
         else:
             yield from self.writeCompact(self._sametypesequence)
     else:
         if self._merge_syns:
             yield from self.writeGeneralMergeSyns()
         else:
             yield from self.writeGeneral()
     if self._dictzip:
         runDictzip(f"{self._filename}.dict")