Now using important_reading data to determine kana answer for kanji.
This commit is contained in:
parent
32bae249db
commit
f743358355
@ -113,12 +113,6 @@ def parse_range(input_range):
|
|||||||
return result
|
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):
|
def get_items_with_level_restriction(level_range, item_state, item_types):
|
||||||
items = []
|
items = []
|
||||||
radical_count = 0
|
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
|
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)):
|
and x['level'] in level_range), loads(current_user.kanji)):
|
||||||
items.extend([{'item_type': 'kanji', 'question': item['character'],
|
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'},
|
'answer_type': 'kana'},
|
||||||
{'item_type': 'kanji', 'question': item['character'], 'answer': item['meaning'],
|
{'item_type': 'kanji', 'question': item['character'], 'answer': item['meaning'],
|
||||||
'answer_type': 'eng'}])
|
'answer_type': 'eng'}])
|
||||||
|
Loading…
Reference in New Issue
Block a user