Skip to content

Instantly share code, notes, and snippets.

@mandel59
Last active July 23, 2023 08:22
Show Gist options
  • Save mandel59/c157d1a7d58e51b5d85b751f9d8fd28e to your computer and use it in GitHub Desktop.
Save mandel59/c157d1a7d58e51b5d85b751f9d8fd28e to your computer and use it in GitHub Desktop.
常用漢字の頭子音の対応表 original: https://twitter.com/lavion_lang/status/1679706083328421889
-- erq <jazh-consonants.erq >jazh-consonants.svg
attach '/Users/mandel59/ws/mojidata/packages/mojidata/dist/moji.db' as mojidata;;
with ja as (k: unihan_kJapaneseOn join o: string_split(k.value, ' ') {UCS, ja_c: ifnull(regexp_substr(lower(o.value), '^(ch|ts|sh|[hfbmtdnrszjkgwy])'), '∅') })
with zh as (k: unihan_kMandarin join p: string_split(k.value, ' ') {UCS, zh_c: ifnull(regexp_substr(p.value, '^(zh|ch|sh|[bpmfdtnlzcsrjqxgkhwy])'), '∅') })
joyo { UCS: 漢字 } join ja using (UCS) join zh using (UCS) { ja_c, zh_c => count: count(distinct UCS) }
output vega lite svg with
encoding {
x: ja_c n sort['h','f','b','m','t','ch','ts','d','n','r','s','sh','z','j','k','g','w','y','∅'],
y: zh_c n sort['b','p','m','f','d','t','n','l','zh','ch','sh','z','c','s','j','q','x','r','g','k','h','w','y','∅']
},
layer(
mark rect, encoding { color: count q };
mark text, encoding { text: count q }
);;
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment