jiru / ccc

Anki deck to review lessons from A Course in Contemporary Chinese
1 stars 0 forks source link

Bopomofo (Zhuyin) support #1

Open heinzelotto opened 11 months ago

heinzelotto commented 11 months ago

Thanks for the great deck! I prefer bopomofo as a transliteration to pinyin, so I programmatically added the corresponding zhuyin to the cards. If you want, I can create a PR that adds that column zhuyin to ccc.tsv.

For card fronts I prefer just the hanzi (mandarin->english) or the translation (english->mandarin), respectively, with all remaining info on the back. So the resulting cards that I currently use are

mandarin->english front: <span lang="zh-tw" id="ddzw-hanzi">{{Hanzi}}</span>

back:

{{FrontSide}}

<hr id=answer>

<span lang="en"><span id="ddzw-zhuyin">{{Zhuyin}}</span><span id="ddzw-pinyin">{{Pinyin}}</span>{{Audio}}<br><br>{{English}}</span><br><br>
{{#Part of speech}}
<span lang="en">({{Part of speech}})</span>
{{/Part of speech}}
<br><br>
<span lang="en"><small>{{Lesson}}</small></span>

<script>
[...]
</script>

english->mandarin front:

{{English}}
<br><br>
{{#Part of speech}}
<span lang="en">({{Part of speech}})</span>
{{/Part of speech}}

back:

{{FrontSide}}

<hr id=answer>
{{Audio}}
<span lang="zh-tw" id="ddzw-hanzi">{{Hanzi}}</span>
<br>
<span lang="en" id="ddzw-zhuyin">{{Zhuyin}}</span>
<span lang="en" id="ddzw-pinyin">{{Pinyin}}</span>
<br><br>
<span lang="en"><small>{{Lesson}}</small></span>

<script>
[...]
</script>

with some styling to display: none; the pinyin. For now, I could just create the PR for the zhuyin and add it to the existing card template, without the restructuring of the card.

jiru commented 9 months ago

Thank you for the kind words! I am glad this deck is useful to others.

Introduction of Zhuyin to the deck is welcomed, however I think it would be better to generate it from the pinyin at build time (or run time) rather than adding it to the source ccc.tsv. As far as I understand, conversion can be fully automated, which means adding it to ccc.tsv would break the principle of single source of truth.

Do you mind elaborating on how you converted the pinyin into zhuyin?