diff options
| author | Lars-Dominik Braun <lars@6xq.net> | 2019-11-06 19:18:08 +0100 | 
|---|---|---|
| committer | Lars-Dominik Braun <lars@6xq.net> | 2019-11-08 21:34:11 +0100 | 
| commit | e31d8731531b41a909bfe33ddc134de07f0a7bab (patch) | |
| tree | 56da3225cfdd4e239c78173803412c1f9e1b5e36 /lulua | |
| parent | 43ad3e898a28798ac2f928041999997c24e7bf3c (diff) | |
| download | lulua-e31d8731531b41a909bfe33ddc134de07f0a7bab.tar.gz lulua-e31d8731531b41a909bfe33ddc134de07f0a7bab.tar.bz2 lulua-e31d8731531b41a909bfe33ddc134de07f0a7bab.zip | |
Add United Nations Parallel Corpus v1.0
See issue #5.
Diffstat (limited to 'lulua')
| -rw-r--r-- | lulua/stats.py | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/lulua/stats.py b/lulua/stats.py index 06168c2..6665ac8 100644 --- a/lulua/stats.py +++ b/lulua/stats.py @@ -218,13 +218,16 @@ def pretty (args):      writer = Writer (layout)      buttonPresses = sum (stats['simple'].buttons.values ()) +    print ('button presses', buttonPresses)      for k, v in sorted (stats['simple'].buttons.items (), key=itemgetter (1)):          print (f'{k} {v:10d} {v/buttonPresses*100:5.1f}%') -    print ('combinations') +      combinationTotal = sum (stats['simple'].combinations.values ()) +    print ('combinations', combinationTotal)      for k, v in sorted (stats['simple'].combinations.items (), key=itemgetter (1)):          t = displayText (layout.getText (k))          print (f'{t:4s} {k} {v:10d} {v/combinationTotal*100:5.1f}%') +      print ('unknown')      for k, v in sorted (stats['simple'].unknown.items (), key=itemgetter (1)):          print (f'{k!r} {v:10d}') @@ -245,9 +248,10 @@ def pretty (args):      for triad, count in sorted (stats['triads'].triads.items (), key=itemgetter (1)):          print (f'{triad} {count:10d}') -    print ('words') +    totalWords = sum (stats['words'].words.values ()) +    print ('words', totalWords)      for word, count in sorted (stats['words'].words.items (), key=itemgetter (1)): -        print (f'{word} {count:10d}') +        print (f'{word:20s} {count/totalWords*100:2.5f} {count:10d}')      effort = Carpalx (models['mod01'], writer)      effort.addTriads (stats['triads'].triads) | 
