git.schokokeks.org
Repositories
Help
Report an Issue
fs-words.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
6a8fba2
Branches
Tags
develop-client_server
master
typescript
fs-words.git
tools
sort.py
added correlatives to list; added several tools
fenris
commited
6a8fba2
at 2016-06-15 10:41:10
sort.py
Blame
History
Raw
import sys import json def index(type_): return { "verb": 00, "attribute": 10, "noun": 20, "pronoun": 30, "correlative": 40, "preposition": 50, "article": 60, "number": 70, "other": 80, }[type_] def main(): data = json.loads(sys.stdin.read()) data_ = sorted(data, key = lambda entry: index(entry["type"])) print(json.dumps(data_, indent="\t")) main()