Open AlexanderBlackman opened 5 years ago
I guess there are three features here, and the difficulty of implementing varies.
I'll have a bit more of a think about this. It could be worthwhile.
Thank you, I'm not familiar with PyQt, but this works if I overwrite silhouette
common_characters = """再谢见听要想起来去点话会的一二三四五六七八九十开关妈爸父母姐哥妹弟兄 是不了在人有我他这个们中来上大为男女儿和国地到以说时要就出会可也你妳我她他对生能而子那得 于着下之年过发后作里用道行所然家种事成方多经么去法学如都同现当没动起看定天分还进好点很 小老大于可以部其些地样心她本前开但因只从想实最被把吗呢吧啊张块条到做作天请太少早晚前后向对"""
def sub_in_hash(matchobj): if str(matchobj.group()) not in common_characters: return '#' else: return str(matchobj.group(0))
def fill_cloze(hanzi, note): if config['target'] in ['pinyin', 'pinyin_tw', 'bopomofo']: target = 'pinyin' field_group = 'pinyin' elif config['target'] in 'jyutping': target = 'jyutping' field_group = 'jyutping' else: raise NotImplementedError(config['target'])
field = get_first(config['fields'][field_group], note) trans = sanitize_transcript(field, target, grouped=False) trans = split_transcript(' '.join(trans), target, grouped=False) hanzi = split_hanzi(cleanup(hanzi), grouped=False) colorized = colorize_fuse(hanzi, trans) characters = re.compile(r"[\u4e00-\u9fff]") colorcloze = characters.sub(sub_in_hash, colorized) set_all(config['fields']['silhouette'], note, to=colorcloze)
Is your feature request related to a problem? Please describe. Anki has a feature that allows you to cover up a preselected part of a sentence in the question card, which is then revealed in the answer.
Unfortunately, this feature isn't usable with ChiSupRedux even when added in manually via card type
Expanding on that, a radical idea would be to do automatic clozes for low-frequency vocabulary, but perhaps that feature would be difficult to implement.
Describe the solution you'd like Being able to use clozes with Anki
Describe alternatives you've considered I currently do it manually.
Additional context Here is an example of one of my manual clozes.