From f743358355ed3b51b3aded760cf7dfe70d6bf814 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Mon, 25 Jan 2016 16:48:41 +0000 Subject: [PATCH] Now using important_reading data to determine kana answer for kanji. --- wanikaniburned.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/wanikaniburned.py b/wanikaniburned.py index 2514373..fe7190e 100644 --- a/wanikaniburned.py +++ b/wanikaniburned.py @@ -113,12 +113,6 @@ def parse_range(input_range): return result -def combine_onyomi_and_kunyomi(onyomi, kunyomi): - if onyomi and kunyomi: - return onyomi + ',' + kunyomi.replace('.*', '') - return onyomi if onyomi else kunyomi.replace('.*', '') - - def get_items_with_level_restriction(level_range, item_state, item_types): items = [] radical_count = 0 @@ -134,7 +128,7 @@ def get_items_with_level_restriction(level_range, item_state, item_types): for item in filter((lambda x: x['user_specific'] and x['user_specific']['srs'] in item_state and x['level'] in level_range), loads(current_user.kanji)): items.extend([{'item_type': 'kanji', 'question': item['character'], - 'answer': combine_onyomi_and_kunyomi(item['onyomi'], item['kunyomi']), + 'answer': item['onyomi'] if item['important_reading'] == 'onyomi' else item['kunyomi'], 'answer_type': 'kana'}, {'item_type': 'kanji', 'question': item['character'], 'answer': item['meaning'], 'answer_type': 'eng'}])