From e31d8731531b41a909bfe33ddc134de07f0a7bab Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Wed, 6 Nov 2019 19:18:08 +0100 Subject: Add United Nations Parallel Corpus v1.0 See issue #5. --- lulua/stats.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lulua') 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) -- cgit v1.2.3