Skip to content

Instantly share code, notes, and snippets.

@gin135
Last active January 10, 2017 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gin135/a8784d239e6187e8a5eab88b050cef1b to your computer and use it in GitHub Desktop.
Save gin135/a8784d239e6187e8a5eab88b050cef1b to your computer and use it in GitHub Desktop.
全元号で使われた漢字を集計するやつ
#!/bin/sh
w3m -dump -cols 200 'https://ja.wikipedia.org/wiki/%E5%85%83%E5%8F%B7%E4%B8%80%E8%A6%A7_(%E6%97%A5%E6%9C%AC)' 2>/dev/null |
grep '[ :][0-9]\{1,2\}年[ ^]' |
grep -v '定められず' |
sed '$d' |
awk '$0=$1' |
tr -d ' ' |
grep -o . |
sort |
uniq -c |
sort -r
@gin135
Copy link
Author

gin135 commented Jan 10, 2017

こちらもhttps://gist.github.com/gin135/c3d7c1c9cb771e0335d40533205e4a67 と同様に修正。
改めて集計結果をば。

 29 永                                                                                                                                                                                   [41/7992]
 27 天
 27 元
 21 治
 20 応
 19 和
 19 文
 19 長
 19 正
 17 安
 16 暦
 16 延
 15 保
 15 徳
 15 寛
 14 承
 13 仁
 12 平
 12 嘉
 10 宝
 10 康
  9 建
  9 慶
  9 久
  8 貞
  8 弘
  8 享
  7 禄
  7 明
  6 大
  5 亀
  4 万                                                                                                                                                                                   [10/7992]
  4 寿
  3 養
  3 中
  3 政
  3 神
  3 喜
  3 観
  3 化
  2 護
  2 雲
  1 雉
  1 祚
  1 老
  1 霊
  1 福
  1 武
  1 白
  1 銅
  1 同
  1 禎
  1 鳥
  1 泰
  1 斉
  1 成
  1 祥
  1 昭
  1 昌
  1 勝
  1 授
  1 朱
  1 字
  1 至
  1 国
  1 衡
  1 景
  1 興
  1 亨
  1 吉
  1 感
  1 乾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment