for uci in self.ucis :
get = list(set(uci.etoiles).intersection(etoiles))
if len(get) > 1 :
- return '2 variables sur la meme ligne'
- elif get != [] :
+ log.info('2 variables sur une ligne')
+ if get != [] :
etuces[etoiles.index(get[0])] += [uce.ident for uce in uci.uces]
etuces = [set(val) for val in etuces]
tab = []
log.info(u'Empty text : %i' % linenb)
iduci -= 1
self.corpus.ucis.pop()
- #raise Exception("EmptyText %i" % linenb)
self.corpus.ucis.append(Uci(iduci, line))
if self.dlg is not None :
if not (iduci + 1) % 10 :
idpara += 1
self.corpus.ucis[-1].paras.append(line.split()[0])
else :
- raise Exception('paragrapheOT')
+ raise Exception('paragrapheOT %i' % linenb)
elif line.strip() != '' and iduci != -1 :
txt.append(line)
if txt != [] and iduci != -1 :
iduce, idpara = self.treattxt(txt, iduce, idpara, iduci)
del(txt)
else :
- raise Exception("EmptyText")
+ if iduci != -1 :
+ iduci -= 1
+ self.corpus.ucis.pop()
+ log.info(Exception("Empty text %i" % linenb))
+ else :
+ raise Exception('EmptyText %i' % linenb)
if iduci != -1 and iduce != -1:
self.backup_uce()
else :
log.info(_(u"No Text in corpora. Are you sure of the formatting ?"))
- raise Exception('TextBeforeTextMark')
+ raise Exception('TextBeforeTextMark %i' % linenb)
except UnicodeDecodeError :
raise Exception("CorpusEncoding")
parametres['originalpath'] = parent.filename
PathOut().createdir(parametres['pathout'])
ReadLexique(self.parent, lang = parametres['lang'])
- self.parent.expressions = ReadDicoAsDico(self.parent.DictPath.get(parametres['lang']+'_exp', 'french_exp'))
+ if parametres['lang'] != 'other' and os.path.exists(self.parent.DictPath.get(parametres['lang']+'_exp', 'french_exp')):
+ self.parent.expressions = ReadDicoAsDico(self.parent.DictPath.get(parametres['lang']+'_exp', 'french_exp'))
+ else :
+ self.parent.expressions = {}
self.parametres = parametres
else :
if self.dlg is not None :