Improving kanjidic format
This commit is contained in:
parent
cac6fc1427
commit
d35d59410a
@ -161,7 +161,7 @@ def parse_kanji_dic(path):
|
|||||||
character = segments[0]
|
character = segments[0]
|
||||||
kunyomi = ' '.join(filter(lambda x: list(filter(is_hiragana, 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:]))
|
onyomi = ' '.join(filter(lambda x: list(filter(is_katakana, x)), segments[1:]))
|
||||||
glossary = '; '.join(re.findall('\{([^\}]+)\}', line))
|
glossary = re.findall('\{([^\}]+)\}', line)
|
||||||
results[character] = (kunyomi or None, onyomi or None, glossary)
|
results[character] = (kunyomi or None, onyomi or None, glossary)
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
7
util/tmpl/kanji-list.html
Normal file
7
util/tmpl/kanji-list.html
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{{> header.html}}
|
||||||
|
{{#each defs}}
|
||||||
|
<div class="definition">
|
||||||
|
{{> kanji.html}}
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
{{> footer.html}}
|
Loading…
Reference in New Issue
Block a user