LoginSignup
2
1

More than 5 years have passed since last update.

ひらがな、カタカナの濁音/半濁音を清音にする

Posted at

以下でできたのでメモ

import unicodedata

ba = 'ば'
unicodedata.normalize("NFKD", ba)[0]

pa = 'ぱ'
unicodedata.normalize("NFKD", pa)[0]

ha = 'は'
unicodedata.normalize("NFKD", ha)[0]

上記3つ、すべて で返ってくる
なお、Python2の場合はunicordにする必要がある

2
1
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
1