LoginSignup
2
0

日本語(15)かなづかい変換

Last updated at Posted at 2019-08-19

韓国と日本のIT業界で協力できるかもしれないこと
https://qiita.com/kaizen_nagoya/items/52501f8ee4dc23f595eb

かな変換1

かなづかいの変換で、旧仮名から新かなへの変換は簡単そう。

旧かな:ゐゑヰヱ

新かな:いえイエ
に変換する。

macOS
$ sed -e "s/ゐ/い/" -e "s/ゑ/え/" -e "s/ヰ/イ/" -e "s/ヱ/エ/" zenbunj.txt > zenbunjn.txt

2文字でも無理やりなら変更できる。

macOS
$ sed -e "s/ゐ/い/" -e "s/ゑ/え/" -e "s/ヰ/イ/" -e "s/ヱ/エ/" -e "s/やう/よう/" -e "s/思ふ/思う/" zenbunj.txt >zenbunjn2.txt
kyushin.sed
s/ゐ/い/
s/ゑ/え/
s/ヰ/イ/
s/ヱ/エ/
s/やう/よう/
s/なふ/なう/
s/ひて/いて/
s/ぢる/じる/
s/をる/おる/
s/すぢ/すじ/
s/会ふ/会う/ 
s/会ひ/会い/ 
s/思ふ/思う/ 
s/思ひ/思い/ 
s/祝ふ/祝う/
s/祝ひ/祝い/
s/伝へ/伝え/
s/変はる/変わる/
s/強ひて/強いて/

参考資料

【Linuxコマンド】sedで文字列を置換する方法
https://www.sejuku.net/blog/54595

sed - テキストの置換や編集をする
https://linuxcommand.net/sed/

Python による日本語自然言語処理
http://www.nltk.org/book-jp/ch12.html

最後までおよみいただきありがとうございました。

いいね 💚、フォローをお願いします。

Thank you very much for reading to the last sentence.

Please press the like icon 💚 and follow me for your happy life.

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0