306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
|
i = 0
nTotOccur = 0
for sWord, nOccur in sorted(self.dWord.items(), key=lambda t: t[1], reverse=True):
xGridDataModel.addRow(i, (sWord, nOccur))
self.xProgressBar.ProgressValue += 1
i += 1
nTotOccur += nOccur
if sWord.lower().endswith(("-je", "-tu", "-il", "-elle", "-on", "-nous", "-vous", "-ils", "-elles", "-iel", "-iels")):
nTotOccur += nOccur
self.xProgressBar.ProgressValue = self.xProgressBar.ProgressValueMax
self.xNumWord.Label = str(i)
self.xTotWord.Label = nTotOccur
def export (self):
if not self.dWord:
|
>
>
>
>
>
>
|
>
|
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
i = 0
nTotOccur = 0
for sWord, nOccur in sorted(self.dWord.items(), key=lambda t: t[1], reverse=True):
xGridDataModel.addRow(i, (sWord, nOccur))
self.xProgressBar.ProgressValue += 1
i += 1
nTotOccur += nOccur
sWord = sWord.lower()
if sWord.endswith(("-le-moi", "-le-toi", "-le-nous", "-le-vous", "le-lui", "-le-leur", \
"-la-moi", "-la-toi", "-la-nous", "-la-vous", "la-lui", "-la-leur", \
"-les-moi", "-les-toi", "-les-nous", "-les-vous", "les-lui", "-les-leur", \
"-m’en", "-t’en", "-lui-en", "-nous-en", "vous-en", "-leur-en")):
nTotOccur += nOccur + nOccur
elif sWord.endswith(("-je", "-tu", "-il", "-elle", "-on", "-nous", "-vous", "-ils", "-elles", "-iel", "-iels", "-le", \
"-la", "-les", "-moi", "-toi", "-leur", "-en", "-y")):
nTotOccur += nOccur
self.xProgressBar.ProgressValue = self.xProgressBar.ProgressValueMax
self.xNumWord.Label = str(i)
self.xTotWord.Label = nTotOccur
def export (self):
if not self.dWord:
|