LoginSignup
14
13

More than 5 years have passed since last update.

文字と濁点・半濁点が分かれていて,それらを結合したい時

Posted at

例えば「レポート」という文字列をユニコードで扱うときに,
文字「ポ」が「ホ + ゜」 というように,文字と濁点・半濁点に分かれてしまう場合

join_dakuten.py
import unicodedata
unicodedata.normalize('NKFC', unistr)

この関数をかませれば
「ホ + ゜」を「ポ」として扱うことができる

14
13
1

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
14
13