duire

french missing verbs with prefix forms
git clone https://a3nm.net/git/duire/
Log | Files | Refs

commit a4e503f35bc1511d04c079e15e4a3a6bbdb35072
parent c96c39b5d5b9792a838ccead9e39aba69838e1c7
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Mon, 23 Mar 2015 01:46:06 +0100

cleanup

Diffstat:
prefix.py | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/prefix.py b/prefix.py @@ -7,9 +7,6 @@ import sys prefixes = {} words = set() interesting = {} -threshold = 2 -maxlen = 2 -keep = 30 exp = 0.2 fwords = open(sys.argv[1]) @@ -32,7 +29,8 @@ for w in words: interesting[w2] = set() interesting[w2].add((w, v)) -sortint = sorted(interesting.items(), key=lambda x: -sum((t[1]**exp for t in x[1]), 0)) +sortint = sorted(interesting.items(), + key=lambda x: -sum((t[1]**exp for t in x[1]), 0)) for (wi, ws) in sortint: ws = sorted(ws, key=operator.itemgetter(1), reverse=True)