1

Order consistently

This commit is contained in:
Alex Yatskov 2016-05-17 20:31:40 -07:00
parent 4cb5163bc9
commit 64a32a0739

View File

@ -41,7 +41,16 @@ class Translator:
self.processTerm(groups, **df)
definitions = groups.values()
definitions = sorted(definitions, key=lambda d: (len(d['source']), 'P' in d['tags'], -len(d['rules'])), reverse=True)
definitions = sorted(
definitions,
reverse=True,
key=lambda d: (
len(d['source']),
'P' in d['tags'],
-len(d['rules']),
d['expression']
)
)
length = 0
for result in definitions: