diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-03-20 12:06:09 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-03-20 12:06:09 -0700 |
commit | 6f256ec25aeafa366b1af8bd628b81741d8ac40d (patch) | |
tree | cf1eb3ae277d6b1dd7763b35f2b0ae06800a835e /util/compile.py | |
parent | fbb763559425744e33d909c550994a36afe66b3e (diff) |
Updating dictionary format
Diffstat (limited to 'util/compile.py')
-rwxr-xr-x | util/compile.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/compile.py b/util/compile.py index 0fd63236..ced550b9 100755 --- a/util/compile.py +++ b/util/compile.py @@ -137,7 +137,7 @@ def parse_krad_file(path): def parse_edict(path): - results = [] + results = {} for line in load_definitions(path): segments = line.split('/') @@ -154,11 +154,11 @@ def parse_edict(path): tags = [] for group in re.findall('\(([^\)\]]+)\)', glossary): tags.extend(group.split(',')) + tags = list(set(tags).intersection(PARSED_TAGS)) - tags = set(tags).intersection(PARSED_TAGS) - tags = ' '.join(sorted(tags)) - - results.append((term, reading, glossary, tags)) + defs = results.get(term, []) + defs.append((reading, glossary, tags)) + results[term] = defs return results |