aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-04-12 20:48:11 -0700
committerAlex Yatskov <alex@foosoft.net>2016-04-12 20:48:11 -0700
commit7d0991f9c1b1379c669c0da9f1f678285dd0c968 (patch)
tree5e230a6a21fc5b426c0caf4314dd37fbcd95d02c
parentcfab4c31eca220ecbab1096b8d11ba7d0d45ed26 (diff)
Updating compiler
-rwxr-xr-xutil/compile.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/util/compile.py b/util/compile.py
index 7510aa9b..b41fdf6d 100755
--- a/util/compile.py
+++ b/util/compile.py
@@ -144,15 +144,14 @@ def load_definitions(path):
def parse_kanji_dic(path):
- results = []
-
+ results = {}
for line in load_definitions(path):
segments = line.split()
character = segments[0]
- kunyomi = ', '.join(filter(lambda x: filter(is_hiragana, x), segments[1:]))
- onyomi = ', '.join(filter(lambda x: filter(is_katakana, x), segments[1:]))
+ kunyomi = ' '.join(filter(lambda x: list(filter(is_hiragana, x)), segments[1:]))
+ onyomi = ' '.join(filter(lambda x: list(filter(is_katakana, x)), segments[1:]))
glossary = '; '.join(re.findall('\{([^\}]+)\}', line))
- results.append((character, kunyomi, onyomi, glossary))
+ results[character] = (kunyomi or None, onyomi or None, glossary)
return results