元ネタ: https://twitter.com/JUMANJIKYO/status/1771847201221677188
MojidataとErqを使って、同様の集計を行う。
- erq-mojidata-playgroundリポジトリを次のコマンドでcloneする
git clone https://github.com/mandel59/erq-mojidata-playground.git
cd erq-mojidata-playground
- unihan_radicals.erqファイルをerq-mojidata-playgroundディレクトリに置く
erq --init mojidata.erq < unihan_radicals.erq
を実行
$ erq --init mojidata.erq < unihan_radicals.erq
Connected to :memory:
attach 'node_modules/@mandel59/mojidata/dist/moji.db' as moji
ok (0.006s)
create table `temp`.radicals_chart as select 部首漢字 as radical, count(distinct UCS) as count from (select UCS, `groups`->>'$."r"' as r, `groups`->>'$."s"' as s from unihan_kRSUnicode join regexp_all(value, '(?<r>\d+)''*\.(?<s>\d+)')) join radicals on r = radical group by (部首漢字)
ok (0.167s)
select * from radicals_chart order by count desc limit 20
["radical","count"]
["艸",3985]
["水",3774]
["口",3708]
["木",3390]
["手",2764]
["金",2678]
["心",2476]
["火",2188]
["人",2107]
["土",1991]
["糸",1945]
["虫",1887]
["竹",1835]
["言",1795]
["女",1761]
["鳥",1733]
["山",1604]
["魚",1551]
["肉",1509]
["玉",1443]
20 rows (0.001s)
select * from radicals_chart
214 rows loaded (0.000s)
WARN Domains that should be unioned has conflicting sort properties. Sort will be set to true.