:mod:`habachen` --- 高速な日本語文字種変換モジュール ==================================================== .. module:: habachen .. testsetup:: * import habachen __name__ = '' -------------- このモジュールは、日本語の全角/半角と、ひらがな/カタカナを相互変換する関数を提供します。 利用可能な関数は以下の通りです: .. function:: hankaku_to_zenkaku(text: str, /, *, ascii: bool = True, digit: bool = True, kana: bool = True) -> str to_zenkaku(text: str, /, *, ascii: bool = True, digit: bool = True, kana: bool = True) -> str han_to_zen(text: str, /, *, ascii: bool = True, digit: bool = True, kana: bool = True) -> str 文字列を受け取り、それに含まれる半角文字を対応する全角文字に変換した新しい文字列を返します。\ 既定の動作では、ASCII文字と半角カタカナ・半角句読点・半角鉤括弧が全角に変換されます。\ 制御文字は変換されません。 '\\' (U+005C) は、全角のバックスラッシュ '\' (U+FF3C) に変換されます。\ 半角の濁点/半濁点は、直前のカナとの組み合わせに対応する全角の合成済み文字が存在する場合には\ それに変換され、存在しない場合には、それぞれ結合文字でない全角の濁点 (U+309B)、半濁点 (U+309C) へと\ 変換されます。 *ascii* オプションを False に設定すると、ASCII文字(数字を除く)が変換されなくなります。 *digit* オプションを False に設定すると、半角数字 (ASCII) が変換されなくなります。 *kana* オプションを False に設定すると、半角カタカナ・半角句読点・半角鉤括弧が変換されなくなります。 以下が使用例です: .. doctest:: # 半角から全角に変換する。既に全角のものは変化なし >>> habachen.hankaku_to_zenkaku('abc!?012ハンカクモジ全角カタカナ') 'abc!?012ハンカクモジ全角カタカナ' # to_zenkaku(), han_to_zen() というエイリアスが用意されている。機能は同じ >>> habachen.to_zenkaku('abc!?012ハンカクモジ全角カタカナ') 'abc!?012ハンカクモジ全角カタカナ' >>> habachen.han_to_zen('abc!?012ハンカクモジ全角カタカナ') 'abc!?012ハンカクモジ全角カタカナ' # 数字以外の ASCII 文字の変換を行わない >>> text = 'abc!?012ハンカクモジ全角カタカナ' >>> habachen.han_to_zen(text, ascii=False) 'abc!?012ハンカクモジ全角カタカナ' # 数字の変換を行わない >>> text = 'abc!?012ハンカクモジ全角カタカナ' >>> habachen.han_to_zen(text, digit=False) 'abc!?012ハンカクモジ全角カタカナ' # 半角カタカナの変換を行わない >>> text = 'abc!?012ハンカクモジ全角カタカナ' >>> habachen.han_to_zen(text, kana=False) 'abc!?012ハンカクモジ全角カタカナ' # ASCII 文字と数字の変換を行わない(半角カタカナのみ変換) >>> text = 'abc!?012ハンカクモジ全角カタカナ' >>> habachen.han_to_zen(text, ascii=False, digit=False) 'abc!?012ハンカクモジ全角カタカナ' .. function:: zenkaku_to_hankaku(text: str, /, *, ascii: bool = True, digit: bool = True, kana: bool = True) -> str to_hankaku(text: str, /, *, ascii: bool = True, digit: bool = True, kana: bool = True) -> str zen_to_han(text: str, /, *, ascii: bool = True, digit: bool = True, kana: bool = True) -> str 文字列を受け取り、それに含まれる全角文字を対応する半角文字に変換した新しい文字列を返します。\ 既定の動作では、対応するASCII文字が存在する全角文字、全角カタカナ、\ 日本語の全角句読点と全角鉤括弧が半角に変換されます。 全角チルダ '~' (U+FF5E) に加え、\ 波ダッシュ '〜' (U+301C) もASCII文字の半角チルダ '~' (U+007E) に変換されます。\ 半角数字に変換されるのは、全角のアラビア数字 (U+FF10-U+FF19) のみです。 *ascii* オプションを False に設定すると、ASCII文字(数字を除く)への変換が行われなくなります。 *digit* オプションを False に設定すると、半角数字 (ASCII) への変換が行われなくなります。 *kana* オプションを False に設定すると、半角カタカナや半角句読点・半角鉤括弧への変換が行われなくなります。 以下が使用例です: .. doctest:: # 全角から半角に変換する。既に半角のものは変化なし >>> habachen.zenkaku_to_hankaku('abc!?012ゼンカクモジハンカクモジ') 'abc!?012ゼンカクモジハンカクモジ' # to_hankaku(), zen_to_han() というエイリアスが用意されている。機能は同じ >>> habachen.to_hankaku('abc!?012ゼンカクモジハンカクモジ') 'abc!?012ゼンカクモジハンカクモジ' >>> habachen.zen_to_han('abc!?012ゼンカクモジハンカクモジ') 'abc!?012ゼンカクモジハンカクモジ' # 数字以外の ASCII 文字への変換を行わない >>> text = 'abc!?012ゼンカクモジハンカクモジ' >>> habachen.zen_to_han(text, ascii=False) 'abc!?012ゼンカクモジハンカクモジ' # 全角数字の変換を行わない >>> text = 'abc!?012ゼンカクモジハンカクモジ' >>> habachen.zen_to_han(text, digit=False) 'abc!?012ゼンカクモジハンカクモジ' # 全角カタカナの変換を行わない >>> text = 'abc!?012ゼンカクモジハンカクモジ' >>> habachen.zen_to_han(text, kana=False) 'abc!?012ゼンカクモジハンカクモジ' # ASCII 文字と数字への変換を行わない(全角カタカナのみ変換) >>> text = 'abc!?012ゼンカクモジハンカクモジ' >>> habachen.zen_to_han(text, ascii=False, digit=False) 'abc!?012ゼンカクモジハンカクモジ' .. function:: hiragana_to_katakana(text: str, /, ignore: Iterable[str] = '', *, hankaku: bool = False) -> str to_katakana(text: str, /, ignore: Iterable[str] = '', *, hankaku: bool = False) -> str hira_to_kata(text: str, /, ignore: Iterable[str] = '', *, hankaku: bool = False) -> str 文字列を受け取り、それに含まれるひらがなを対応するカタカナ(既定では全角カタカナ)に変換した新しい文字列を返します。\ オプション引数 *ignore* に含まれるひらがなは変換されません。 *ignore* 引数に渡すことができるのは、ひらがな文字列、あるいはひらがな文字列のイテラブルで、\ カタカナに変換できない文字を含んでいてはなりません。 *hankaku* オプションを True に設定すると、ひらがなは全角カタカナではなく半角カタカナに変換されるようになります。 以下が使用例です: .. doctest:: # ひらがなをカタカナに変換する。ひらがな以外は変換されない >>> habachen.hiragana_to_katakana('もじれつの変換') 'モジレツノ変換' # to_katakana(), hira_to_kata() というエイリアスが用意されている。機能は同じ >>> habachen.to_katakana('もじれつの変換') 'モジレツノ変換' >>> habachen.hira_to_kata('もじれつの変換') 'モジレツノ変換' # オプション引数 ignore で指定したひらがなは変換されない >>> text = 'てすとです' >>> habachen.to_katakana(text) 'テストデス' >>> habachen.to_katakana(text, ignore='す') 'テすトデす' >>> habachen.to_katakana('あいうえおかきくけこ', ignore='あか') 'あイウエオかキクケコ' # ignore には、任意のイテラブル(リストなど)を指定可能。 ''.join(ignore) の結果が使われる >>> habachen.to_katakana('らりるれろやいゆえよわをん', ignore=['やゆよ', 'わ', 'ん']) 'ラリルレロやイゆエよわヲん' # ひらがなを半角カタカナに変換 >>> habachen.to_katakana('もじれつの変換', hankaku=True) 'モジレツノ変換' .. function:: katakana_to_hiragana(text: str, /, ignore: Iterable[str] = '') -> str to_hiragana(text: str, /, ignore: Iterable[str] = '') -> str kata_to_hira(text: str, /, ignore: Iterable[str] = '') -> str 文字列を受け取り、それに含まれる全角カタカナを対応するひらがなに変換した新しい文字列を返します。\ オプション引数 *ignore* に含まれるカタカナは変換されません。 *ignore* 引数に渡すことができるのは、カタカナ文字列、あるいはカタカナ文字列のイテラブルで、\ ひらがなに変換できない文字を含んでいてはなりません。 .. note:: 半角カタカナからひらがなへの変換はサポートしていません。 以下が使用例です: .. doctest:: # 全角カタカナをひらがなに変換する。カタカナ以外は変換されない >>> habachen.katakana_to_hiragana('モジレツノ変換') 'もじれつの変換' # to_hiragana(), kata_to_hira() というエイリアスが用意されている。機能は同じ >>> habachen.to_hiragana('モジレツノ変換') 'もじれつの変換' >>> habachen.kata_to_hira('モジレツノ変換') 'もじれつの変換' # オプション引数 ignore で指定したカタカナは変換されない >>> text = 'テストデス' >>> habachen.to_hiragana(text) 'てすとです' >>> habachen.to_hiragana(text, ignore='ス') 'てスとでス' >>> habachen.to_hiragana('アイウエオカキクケコ', ignore='アカ') 'アいうえおカきくけこ' # ignore には、任意のイテラブル(リストなど)を指定可能。 ''.join(ignore) の結果が使われる >>> habachen.to_hiragana('ラリルレロヤイユエヨワヲン', ignore=['ヤユヨ', 'ワ', 'ン']) 'らりるれろヤいユえヨワをン' -------------- APPENDIX: 変換テーブル ********************** .. table:: 半角文字→全角文字 :align: center +---------+--------------------------------+--------------------------------+ | 種別 | 半角文字 | 対応する全角文字 | +=========+================================+================================+ | ascii | ' ' (U+0020) | ' ' (U+3000) | +---------+--------------------------------+--------------------------------+ | | '!' (U+0021) ~ '/' (U+002F) | '!' (U+FF01) ~ '/' (U+FF0F) | +---------+--------------------------------+--------------------------------+ | | ':' (U+003A) ~ '~' (U+007E) | ':' (U+FF1A) ~ '~' (U+FF5E) | +---------+--------------------------------+--------------------------------+ | digit | '0' (U+0030) ~ '9' (U+0039) | '0' (U+FF10) ~ '9' (U+FF19) | +---------+--------------------------------+--------------------------------+ | kana | '。' (U+FF61) | '。' (U+3002) | +---------+--------------------------------+--------------------------------+ | | '「' (U+FF62) ~ '」' (U+FF63) | '「' (U+300C) ~ '」' (U+300D) | +---------+--------------------------------+--------------------------------+ | | '、' (U+FF64) | '、' (U+3001) | +---------+--------------------------------+--------------------------------+ | | '・' (U+FF65) | '・' (U+30FB) | +---------+--------------------------------+--------------------------------+ | | 'ヲ' (U+FF66) | 'ヲ' (U+30F2) | +---------+--------------------------------+--------------------------------+ | | 'ヺ' (U+FF66 U+FF9E) | 'ヺ' (U+30FA) | +---------+--------------------------------+--------------------------------+ | | 'ァ' (U+FF67) | 'ァ' (U+30A1) | +---------+--------------------------------+--------------------------------+ | | 'ィ' (U+FF68) | 'ィ' (U+30A3) | +---------+--------------------------------+--------------------------------+ | | 'ゥ' (U+FF69) | 'ゥ' (U+30A5) | +---------+--------------------------------+--------------------------------+ | | 'ェ' (U+FF6A) | 'ェ' (U+30A7) | +---------+--------------------------------+--------------------------------+ | | 'ォ' (U+FF6B) | 'ォ' (U+30A9) | +---------+--------------------------------+--------------------------------+ | | 'ャ' (U+FF6C) | 'ャ' (U+30E3) | +---------+--------------------------------+--------------------------------+ | | 'ュ' (U+FF6D) | 'ュ' (U+30E5) | +---------+--------------------------------+--------------------------------+ | | 'ョ' (U+FF6E) | 'ョ' (U+30E7) | +---------+--------------------------------+--------------------------------+ | | 'ッ' (U+FF6F) | 'ッ' (U+30C3) | +---------+--------------------------------+--------------------------------+ | | 'ー' (U+FF70) | 'ー' (U+30FC) | +---------+--------------------------------+--------------------------------+ | | 'ア' (U+FF71) | 'ア' (U+30A2) | +---------+--------------------------------+--------------------------------+ | | 'イ' (U+FF72) | 'イ' (U+30A4) | +---------+--------------------------------+--------------------------------+ | | 'ウ' (U+FF73) | 'ウ' (U+30A6) | +---------+--------------------------------+--------------------------------+ | | 'ヴ' (U+FF73 U+FF9E) | 'ヴ' (U+30F4) | +---------+--------------------------------+--------------------------------+ | | 'エ' (U+FF74) | 'エ' (U+30A8) | +---------+--------------------------------+--------------------------------+ | | 'オ' (U+FF75) | 'オ' (U+30AA) | +---------+--------------------------------+--------------------------------+ | | 'カ' (U+FF76) | 'カ' (U+30AB) | +---------+--------------------------------+--------------------------------+ | | 'ガ' (U+FF76 U+FF9E) | 'ガ' (U+30AC) | +---------+--------------------------------+--------------------------------+ | | 'キ' (U+FF77) | 'キ' (U+30AD) | +---------+--------------------------------+--------------------------------+ | | 'ギ' (U+FF77 U+FF9E) | 'ギ' (U+30AE) | +---------+--------------------------------+--------------------------------+ | | 'ク' (U+FF78) | 'ク' (U+30AF) | +---------+--------------------------------+--------------------------------+ | | 'グ' (U+FF78 U+FF9E) | 'グ' (U+30B0) | +---------+--------------------------------+--------------------------------+ | | 'ケ' (U+FF79) | 'ケ' (U+30B1) | +---------+--------------------------------+--------------------------------+ | | 'ゲ' (U+FF79 U+FF9E) | 'ゲ' (U+30B2) | +---------+--------------------------------+--------------------------------+ | | 'コ' (U+FF7A) | 'コ' (U+30B3) | +---------+--------------------------------+--------------------------------+ | | 'ゴ' (U+FF7A U+FF9E) | 'ゴ' (U+30B4) | +---------+--------------------------------+--------------------------------+ | | 'サ' (U+FF7B) | 'サ' (U+30B5) | +---------+--------------------------------+--------------------------------+ | | 'ザ' (U+FF7B U+FF9E) | 'ザ' (U+30B6) | +---------+--------------------------------+--------------------------------+ | | 'シ' (U+FF7C) | 'シ' (U+30B7) | +---------+--------------------------------+--------------------------------+ | | 'ジ' (U+FF7C U+FF9E) | 'ジ' (U+30B8) | +---------+--------------------------------+--------------------------------+ | | 'ス' (U+FF7D) | 'ス' (U+30B9) | +---------+--------------------------------+--------------------------------+ | | 'ズ' (U+FF7D U+FF9E) | 'ズ' (U+30BA) | +---------+--------------------------------+--------------------------------+ | | 'セ' (U+FF7E) | 'セ' (U+30BB) | +---------+--------------------------------+--------------------------------+ | | 'ゼ' (U+FF7E U+FF9E) | 'ゼ' (U+30BC) | +---------+--------------------------------+--------------------------------+ | | 'ソ' (U+FF7F) | 'ソ' (U+30BD) | +---------+--------------------------------+--------------------------------+ | | 'ゾ' (U+FF7F U+FF9E) | 'ゾ' (U+30BE) | +---------+--------------------------------+--------------------------------+ | | 'タ' (U+FF80) | 'タ' (U+30BF) | +---------+--------------------------------+--------------------------------+ | | 'ダ' (U+FF80 U+FF9E) | 'ダ' (U+30C0) | +---------+--------------------------------+--------------------------------+ | | 'チ' (U+FF81) | 'チ' (U+30C1) | +---------+--------------------------------+--------------------------------+ | | 'ヂ' (U+FF81 U+FF9E) | 'ヂ' (U+30C2) | +---------+--------------------------------+--------------------------------+ | | 'ツ' (U+FF82) | 'ツ' (U+30C4) | +---------+--------------------------------+--------------------------------+ | | 'ヅ' (U+FF82 U+FF9E) | 'ヅ' (U+30C5) | +---------+--------------------------------+--------------------------------+ | | 'テ' (U+FF83) | 'テ' (U+30C6) | +---------+--------------------------------+--------------------------------+ | | 'デ' (U+FF83 U+FF9E) | 'デ' (U+30C7) | +---------+--------------------------------+--------------------------------+ | | 'ト' (U+FF84) | 'ト' (U+30C8) | +---------+--------------------------------+--------------------------------+ | | 'ド' (U+FF84 U+FF9E) | 'ド' (U+30C9) | +---------+--------------------------------+--------------------------------+ | | 'ナ' (U+FF85) | 'ナ' (U+30CA) | +---------+--------------------------------+--------------------------------+ | | 'ニ' (U+FF86) | 'ニ' (U+30CB) | +---------+--------------------------------+--------------------------------+ | | 'ヌ' (U+FF87) | 'ヌ' (U+30CC) | +---------+--------------------------------+--------------------------------+ | | 'ネ' (U+FF88) | 'ネ' (U+30CD) | +---------+--------------------------------+--------------------------------+ | | 'ノ' (U+FF89) | 'ノ' (U+30CE) | +---------+--------------------------------+--------------------------------+ | | 'ハ' (U+FF8A) | 'ハ' (U+30CF) | +---------+--------------------------------+--------------------------------+ | | 'バ' (U+FF8A U+FF9E) | 'バ' (U+30D0) | +---------+--------------------------------+--------------------------------+ | | 'パ' (U+FF8A U+FF9F) | 'パ' (U+30D1) | +---------+--------------------------------+--------------------------------+ | | 'ヒ' (U+FF8B) | 'ヒ' (U+30D2) | +---------+--------------------------------+--------------------------------+ | | 'ビ' (U+FF8B U+FF9E) | 'ビ' (U+30D3) | +---------+--------------------------------+--------------------------------+ | | 'ピ' (U+FF8B U+FF9F) | 'ピ' (U+30D4) | +---------+--------------------------------+--------------------------------+ | | 'フ' (U+FF8C) | 'フ' (U+30D5) | +---------+--------------------------------+--------------------------------+ | | 'ブ' (U+FF8C U+FF9E) | 'ブ' (U+30D6) | +---------+--------------------------------+--------------------------------+ | | 'プ' (U+FF8C U+FF9F) | 'プ' (U+30D7) | +---------+--------------------------------+--------------------------------+ | | 'ヘ' (U+FF8D) | 'ヘ' (U+30D8) | +---------+--------------------------------+--------------------------------+ | | 'ベ' (U+FF8D U+FF9E) | 'ベ' (U+30D9) | +---------+--------------------------------+--------------------------------+ | | 'ペ' (U+FF8D U+FF9F) | 'ペ' (U+30DA) | +---------+--------------------------------+--------------------------------+ | | 'ホ' (U+FF8E) | 'ホ' (U+30DB) | +---------+--------------------------------+--------------------------------+ | | 'ボ' (U+FF8E U+FF9E) | 'ボ' (U+30DC) | +---------+--------------------------------+--------------------------------+ | | 'ポ' (U+FF8E U+FF9F) | 'ポ' (U+30DD) | +---------+--------------------------------+--------------------------------+ | | 'マ' (U+FF8F) | 'マ' (U+30DE) | +---------+--------------------------------+--------------------------------+ | | 'ミ' (U+FF90) | 'ミ' (U+30DF) | +---------+--------------------------------+--------------------------------+ | | 'ム' (U+FF91) | 'ム' (U+30E0) | +---------+--------------------------------+--------------------------------+ | | 'メ' (U+FF92) | 'メ' (U+30E1) | +---------+--------------------------------+--------------------------------+ | | 'モ' (U+FF93) | 'モ' (U+30E2) | +---------+--------------------------------+--------------------------------+ | | 'ヤ' (U+FF94) | 'ヤ' (U+30E4) | +---------+--------------------------------+--------------------------------+ | | 'ユ' (U+FF95) | 'ユ' (U+30E6) | +---------+--------------------------------+--------------------------------+ | | 'ヨ' (U+FF96) | 'ヨ' (U+30E8) | +---------+--------------------------------+--------------------------------+ | | 'ラ' (U+FF97) | 'ラ' (U+30E9) | +---------+--------------------------------+--------------------------------+ | | 'リ' (U+FF98) | 'リ' (U+30EA) | +---------+--------------------------------+--------------------------------+ | | 'ル' (U+FF99) | 'ル' (U+30EB) | +---------+--------------------------------+--------------------------------+ | | 'レ' (U+FF9A) | 'レ' (U+30EC) | +---------+--------------------------------+--------------------------------+ | | 'ロ' (U+FF9B) | 'ロ' (U+30ED) | +---------+--------------------------------+--------------------------------+ | | 'ワ' (U+FF9C) | 'ワ' (U+30EF) | +---------+--------------------------------+--------------------------------+ | | 'ヷ' (U+FF9C U+FF9E) | 'ヷ' (U+30F7) | +---------+--------------------------------+--------------------------------+ | | 'ン' (U+FF9D) | 'ン' (U+30F3) | +---------+--------------------------------+--------------------------------+ | | '゙' (U+FF9E) ~ '゚' (U+FF9F) | '゛' (U+309B) ~ '゜' (U+309C) | +---------+--------------------------------+--------------------------------+ .. table:: 全角文字→半角文字 :align: center +---------+--------------------------------+--------------------------------+ | 種別 | 全角文字 | 対応する半角文字 | +=========+================================+================================+ | ascii | ' ' (U+3000) | ' ' (U+0020) | +---------+--------------------------------+--------------------------------+ | | '〜' (U+301C) | '~' (U+007E) | +---------+--------------------------------+--------------------------------+ | | '!' (U+FF01) ~ '/' (U+FF0F) | '!' (U+0021) ~ '/' (U+002F) | +---------+--------------------------------+--------------------------------+ | | ':' (U+FF1A) ~ '~' (U+FF5E) | ':' (U+003A) ~ '~' (U+007E) | +---------+--------------------------------+--------------------------------+ | digit | '0' (U+FF10) ~ '9' (U+FF19) | '0' (U+0030) ~ '9' (U+0039) | +---------+--------------------------------+--------------------------------+ | kana | '゛' (U+309B) ~ '゜' (U+309C) | '゙' (U+FF9E) ~ '゚' (U+FF9F) | +---------+--------------------------------+--------------------------------+ | | 'ァ' (U+30A1) | 'ァ' (U+FF67) | +---------+--------------------------------+--------------------------------+ | | 'ア' (U+30A2) | 'ア' (U+FF71) | +---------+--------------------------------+--------------------------------+ | | 'ィ' (U+30A3) | 'ィ' (U+FF68) | +---------+--------------------------------+--------------------------------+ | | 'イ' (U+30A4) | 'イ' (U+FF72) | +---------+--------------------------------+--------------------------------+ | | 'ゥ' (U+30A5) | 'ゥ' (U+FF69) | +---------+--------------------------------+--------------------------------+ | | 'ウ' (U+30A6) | 'ウ' (U+FF73) | +---------+--------------------------------+--------------------------------+ | | 'ェ' (U+30A7) | 'ェ' (U+FF6A) | +---------+--------------------------------+--------------------------------+ | | 'エ' (U+30A8) | 'エ' (U+FF74) | +---------+--------------------------------+--------------------------------+ | | 'ォ' (U+30A9) | 'ォ' (U+FF6B) | +---------+--------------------------------+--------------------------------+ | | 'オ' (U+30AA) | 'オ' (U+FF75) | +---------+--------------------------------+--------------------------------+ | | 'カ' (U+30AB) | 'カ' (U+FF76) | +---------+--------------------------------+--------------------------------+ | | 'ガ' (U+30AC) | 'ガ' (U+FF76 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'キ' (U+30AD) | 'キ' (U+FF77) | +---------+--------------------------------+--------------------------------+ | | 'ギ' (U+30AE) | 'ギ' (U+FF77 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ク' (U+30AF) | 'ク' (U+FF78) | +---------+--------------------------------+--------------------------------+ | | 'グ' (U+30B0) | 'グ' (U+FF78 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ケ' (U+30B1) | 'ケ' (U+FF79) | +---------+--------------------------------+--------------------------------+ | | 'ゲ' (U+30B2) | 'ゲ' (U+FF79 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'コ' (U+30B3) | 'コ' (U+FF7A) | +---------+--------------------------------+--------------------------------+ | | 'ゴ' (U+30B4) | 'ゴ' (U+FF7A U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'サ' (U+30B5) | 'サ' (U+FF7B) | +---------+--------------------------------+--------------------------------+ | | 'ザ' (U+30B6) | 'ザ' (U+FF7B U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'シ' (U+30B7) | 'シ' (U+FF7C) | +---------+--------------------------------+--------------------------------+ | | 'ジ' (U+30B8) | 'ジ' (U+FF7C U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ス' (U+30B9) | 'ス' (U+FF7D) | +---------+--------------------------------+--------------------------------+ | | 'ズ' (U+30BA) | 'ズ' (U+FF7D U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'セ' (U+30BB) | 'セ' (U+FF7E) | +---------+--------------------------------+--------------------------------+ | | 'ゼ' (U+30BC) | 'ゼ' (U+FF7E U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ソ' (U+30BD) | 'ソ' (U+FF7F) | +---------+--------------------------------+--------------------------------+ | | 'ゾ' (U+30BE) | 'ゾ' (U+FF7F U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'タ' (U+30BF) | 'タ' (U+FF80) | +---------+--------------------------------+--------------------------------+ | | 'ダ' (U+30C0) | 'ダ' (U+FF80 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'チ' (U+30C1) | 'チ' (U+FF81) | +---------+--------------------------------+--------------------------------+ | | 'ヂ' (U+30C2) | 'ヂ' (U+FF81 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ッ' (U+30C3) | 'ッ' (U+FF6F) | +---------+--------------------------------+--------------------------------+ | | 'ツ' (U+30C4) | 'ツ' (U+FF82) | +---------+--------------------------------+--------------------------------+ | | 'ヅ' (U+30C5) | 'ヅ' (U+FF82 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'テ' (U+30C6) | 'テ' (U+FF83) | +---------+--------------------------------+--------------------------------+ | | 'デ' (U+30C7) | 'デ' (U+FF83 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ト' (U+30C8) | 'ト' (U+FF84) | +---------+--------------------------------+--------------------------------+ | | 'ド' (U+30C9) | 'ド' (U+FF84 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ナ' (U+30CA) | 'ナ' (U+FF85) | +---------+--------------------------------+--------------------------------+ | | 'ニ' (U+30CB) | 'ニ' (U+FF86) | +---------+--------------------------------+--------------------------------+ | | 'ヌ' (U+30CC) | 'ヌ' (U+FF87) | +---------+--------------------------------+--------------------------------+ | | 'ネ' (U+30CD) | 'ネ' (U+FF88) | +---------+--------------------------------+--------------------------------+ | | 'ノ' (U+30CE) | 'ノ' (U+FF89) | +---------+--------------------------------+--------------------------------+ | | 'ハ' (U+30CF) | 'ハ' (U+FF8A) | +---------+--------------------------------+--------------------------------+ | | 'バ' (U+30D0) | 'バ' (U+FF8A U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'パ' (U+30D1) | 'パ' (U+FF8A U+FF9F) | +---------+--------------------------------+--------------------------------+ | | 'ヒ' (U+30D2) | 'ヒ' (U+FF8B) | +---------+--------------------------------+--------------------------------+ | | 'ビ' (U+30D3) | 'ビ' (U+FF8B U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ピ' (U+30D4) | 'ピ' (U+FF8B U+FF9F) | +---------+--------------------------------+--------------------------------+ | | 'フ' (U+30D5) | 'フ' (U+FF8C) | +---------+--------------------------------+--------------------------------+ | | 'ブ' (U+30D6) | 'ブ' (U+FF8C U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'プ' (U+30D7) | 'プ' (U+FF8C U+FF9F) | +---------+--------------------------------+--------------------------------+ | | 'ヘ' (U+30D8) | 'ヘ' (U+FF8D) | +---------+--------------------------------+--------------------------------+ | | 'ベ' (U+30D9) | 'ベ' (U+FF8D U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ペ' (U+30DA) | 'ペ' (U+FF8D U+FF9F) | +---------+--------------------------------+--------------------------------+ | | 'ホ' (U+30DB) | 'ホ' (U+FF8E) | +---------+--------------------------------+--------------------------------+ | | 'ボ' (U+30DC) | 'ボ' (U+FF8E U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ポ' (U+30DD) | 'ポ' (U+FF8E U+FF9F) | +---------+--------------------------------+--------------------------------+ | | 'マ' (U+30DE) | 'マ' (U+FF8F) | +---------+--------------------------------+--------------------------------+ | | 'ミ' (U+30DF) | 'ミ' (U+FF90) | +---------+--------------------------------+--------------------------------+ | | 'ム' (U+30E0) | 'ム' (U+FF91) | +---------+--------------------------------+--------------------------------+ | | 'メ' (U+30E1) | 'メ' (U+FF92) | +---------+--------------------------------+--------------------------------+ | | 'モ' (U+30E2) | 'モ' (U+FF93) | +---------+--------------------------------+--------------------------------+ | | 'ャ' (U+30E3) | 'ャ' (U+FF6C) | +---------+--------------------------------+--------------------------------+ | | 'ヤ' (U+30E4) | 'ヤ' (U+FF94) | +---------+--------------------------------+--------------------------------+ | | 'ュ' (U+30E5) | 'ュ' (U+FF6D) | +---------+--------------------------------+--------------------------------+ | | 'ユ' (U+30E6) | 'ユ' (U+FF95) | +---------+--------------------------------+--------------------------------+ | | 'ョ' (U+30E7) | 'ョ' (U+FF6E) | +---------+--------------------------------+--------------------------------+ | | 'ヨ' (U+30E8) | 'ヨ' (U+FF96) | +---------+--------------------------------+--------------------------------+ | | 'ラ' (U+30E9) | 'ラ' (U+FF97) | +---------+--------------------------------+--------------------------------+ | | 'リ' (U+30EA) | 'リ' (U+FF98) | +---------+--------------------------------+--------------------------------+ | | 'ル' (U+30EB) | 'ル' (U+FF99) | +---------+--------------------------------+--------------------------------+ | | 'レ' (U+30EC) | 'レ' (U+FF9A) | +---------+--------------------------------+--------------------------------+ | | 'ロ' (U+30ED) | 'ロ' (U+FF9B) | +---------+--------------------------------+--------------------------------+ | | 'ワ' (U+30EF) | 'ワ' (U+FF9C) | +---------+--------------------------------+--------------------------------+ | | 'ヲ' (U+30F2) | 'ヲ' (U+FF66) | +---------+--------------------------------+--------------------------------+ | | 'ン' (U+30F3) | 'ン' (U+FF9D) | +---------+--------------------------------+--------------------------------+ | | 'ヴ' (U+30F4) | 'ヴ' (U+FF73 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ヷ' (U+30F7) | 'ヷ' (U+FF9C U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ヺ' (U+30FA) | 'ヺ' (U+FF66 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | '・' (U+30FB) | '・' (U+FF65) | +---------+--------------------------------+--------------------------------+ | | 'ー' (U+30FC) | 'ー' (U+FF70) | +---------+--------------------------------+--------------------------------+ .. table:: ひらがな→全角カタカナ :align: center +---------+--------------------------------+--------------------------------+ | 種別 | ひらがな | 全角カタカナ | +=========+================================+================================+ | ... | 'ぁ' (U+3041) ~ 'ゖ' (U+3096) | 'ァ' (U+30A1) ~ 'ヶ' (U+30F6) | +---------+--------------------------------+--------------------------------+ | | 'ゝ' (U+309D) ~ 'ゞ' (U+309E) | 'ヽ' (U+30FD) ~ 'ヾ' (U+30FE) | +---------+--------------------------------+--------------------------------+ .. table:: ひらがな→半角カタカナ :align: center +---------+--------------------------------+--------------------------------+ | 種別 | ひらがな | 半角カタカナ | +=========+================================+================================+ | hankaku | 'ぁ' (U+3041) | 'ァ' (U+FF67) | +---------+--------------------------------+--------------------------------+ | | 'あ' (U+3042) | 'ア' (U+FF71) | +---------+--------------------------------+--------------------------------+ | | 'ぃ' (U+3043) | 'ィ' (U+FF68) | +---------+--------------------------------+--------------------------------+ | | 'い' (U+3044) | 'イ' (U+FF72) | +---------+--------------------------------+--------------------------------+ | | 'ぅ' (U+3045) | 'ゥ' (U+FF69) | +---------+--------------------------------+--------------------------------+ | | 'う' (U+3046) | 'ウ' (U+FF73) | +---------+--------------------------------+--------------------------------+ | | 'ぇ' (U+3047) | 'ェ' (U+FF6A) | +---------+--------------------------------+--------------------------------+ | | 'え' (U+3048) | 'エ' (U+FF74) | +---------+--------------------------------+--------------------------------+ | | 'ぉ' (U+3049) | 'ォ' (U+FF6B) | +---------+--------------------------------+--------------------------------+ | | 'お' (U+304A) | 'オ' (U+FF75) | +---------+--------------------------------+--------------------------------+ | | 'か' (U+304B) | 'カ' (U+FF76) | +---------+--------------------------------+--------------------------------+ | | 'が' (U+304C) | 'ガ' (U+FF76 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'き' (U+304D) | 'キ' (U+FF77) | +---------+--------------------------------+--------------------------------+ | | 'ぎ' (U+304E) | 'ギ' (U+FF77 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'く' (U+304F) | 'ク' (U+FF78) | +---------+--------------------------------+--------------------------------+ | | 'ぐ' (U+3050) | 'グ' (U+FF78 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'け' (U+3051) | 'ケ' (U+FF79) | +---------+--------------------------------+--------------------------------+ | | 'げ' (U+3052) | 'ゲ' (U+FF79 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'こ' (U+3053) | 'コ' (U+FF7A) | +---------+--------------------------------+--------------------------------+ | | 'ご' (U+3054) | 'ゴ' (U+FF7A U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'さ' (U+3055) | 'サ' (U+FF7B) | +---------+--------------------------------+--------------------------------+ | | 'ざ' (U+3056) | 'ザ' (U+FF7B U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'し' (U+3057) | 'シ' (U+FF7C) | +---------+--------------------------------+--------------------------------+ | | 'じ' (U+3058) | 'ジ' (U+FF7C U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'す' (U+3059) | 'ス' (U+FF7D) | +---------+--------------------------------+--------------------------------+ | | 'ず' (U+305A) | 'ズ' (U+FF7D U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'せ' (U+305B) | 'セ' (U+FF7E) | +---------+--------------------------------+--------------------------------+ | | 'ぜ' (U+305C) | 'ゼ' (U+FF7E U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'そ' (U+305D) | 'ソ' (U+FF7F) | +---------+--------------------------------+--------------------------------+ | | 'ぞ' (U+305E) | 'ゾ' (U+FF7F U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'た' (U+305F) | 'タ' (U+FF80) | +---------+--------------------------------+--------------------------------+ | | 'だ' (U+3060) | 'ダ' (U+FF80 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ち' (U+3061) | 'チ' (U+FF81) | +---------+--------------------------------+--------------------------------+ | | 'ぢ' (U+3062) | 'ヂ' (U+FF81 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'っ' (U+3063) | 'ッ' (U+FF6F) | +---------+--------------------------------+--------------------------------+ | | 'つ' (U+3064) | 'ツ' (U+FF82) | +---------+--------------------------------+--------------------------------+ | | 'づ' (U+3065) | 'ヅ' (U+FF82 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'て' (U+3066) | 'テ' (U+FF83) | +---------+--------------------------------+--------------------------------+ | | 'で' (U+3067) | 'デ' (U+FF83 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'と' (U+3068) | 'ト' (U+FF84) | +---------+--------------------------------+--------------------------------+ | | 'ど' (U+3069) | 'ド' (U+FF84 U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'な' (U+306A) | 'ナ' (U+FF85) | +---------+--------------------------------+--------------------------------+ | | 'に' (U+306B) | 'ニ' (U+FF86) | +---------+--------------------------------+--------------------------------+ | | 'ぬ' (U+306C) | 'ヌ' (U+FF87) | +---------+--------------------------------+--------------------------------+ | | 'ね' (U+306D) | 'ネ' (U+FF88) | +---------+--------------------------------+--------------------------------+ | | 'の' (U+306E) | 'ノ' (U+FF89) | +---------+--------------------------------+--------------------------------+ | | 'は' (U+306F) | 'ハ' (U+FF8A) | +---------+--------------------------------+--------------------------------+ | | 'ば' (U+3070) | 'バ' (U+FF8A U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ぱ' (U+3071) | 'パ' (U+FF8A U+FF9F) | +---------+--------------------------------+--------------------------------+ | | 'ひ' (U+3072) | 'ヒ' (U+FF8B) | +---------+--------------------------------+--------------------------------+ | | 'び' (U+3073) | 'ビ' (U+FF8B U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ぴ' (U+3074) | 'ピ' (U+FF8B U+FF9F) | +---------+--------------------------------+--------------------------------+ | | 'ふ' (U+3075) | 'フ' (U+FF8C) | +---------+--------------------------------+--------------------------------+ | | 'ぶ' (U+3076) | 'ブ' (U+FF8C U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ぷ' (U+3077) | 'プ' (U+FF8C U+FF9F) | +---------+--------------------------------+--------------------------------+ | | 'へ' (U+3078) | 'ヘ' (U+FF8D) | +---------+--------------------------------+--------------------------------+ | | 'べ' (U+3079) | 'ベ' (U+FF8D U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ぺ' (U+307A) | 'ペ' (U+FF8D U+FF9F) | +---------+--------------------------------+--------------------------------+ | | 'ほ' (U+307B) | 'ホ' (U+FF8E) | +---------+--------------------------------+--------------------------------+ | | 'ぼ' (U+307C) | 'ボ' (U+FF8E U+FF9E) | +---------+--------------------------------+--------------------------------+ | | 'ぽ' (U+307D) | 'ポ' (U+FF8E U+FF9F) | +---------+--------------------------------+--------------------------------+ | | 'ま' (U+307E) | 'マ' (U+FF8F) | +---------+--------------------------------+--------------------------------+ | | 'み' (U+307F) | 'ミ' (U+FF90) | +---------+--------------------------------+--------------------------------+ | | 'む' (U+3080) | 'ム' (U+FF91) | +---------+--------------------------------+--------------------------------+ | | 'め' (U+3081) | 'メ' (U+FF92) | +---------+--------------------------------+--------------------------------+ | | 'も' (U+3082) | 'モ' (U+FF93) | +---------+--------------------------------+--------------------------------+ | | 'ゃ' (U+3083) | 'ャ' (U+FF6C) | +---------+--------------------------------+--------------------------------+ | | 'や' (U+3084) | 'ヤ' (U+FF94) | +---------+--------------------------------+--------------------------------+ | | 'ゅ' (U+3085) | 'ュ' (U+FF6D) | +---------+--------------------------------+--------------------------------+ | | 'ゆ' (U+3086) | 'ユ' (U+FF95) | +---------+--------------------------------+--------------------------------+ | | 'ょ' (U+3087) | 'ョ' (U+FF6E) | +---------+--------------------------------+--------------------------------+ | | 'よ' (U+3088) | 'ヨ' (U+FF96) | +---------+--------------------------------+--------------------------------+ | | 'ら' (U+3089) | 'ラ' (U+FF97) | +---------+--------------------------------+--------------------------------+ | | 'り' (U+308A) | 'リ' (U+FF98) | +---------+--------------------------------+--------------------------------+ | | 'る' (U+308B) | 'ル' (U+FF99) | +---------+--------------------------------+--------------------------------+ | | 'れ' (U+308C) | 'レ' (U+FF9A) | +---------+--------------------------------+--------------------------------+ | | 'ろ' (U+308D) | 'ロ' (U+FF9B) | +---------+--------------------------------+--------------------------------+ | | 'わ' (U+308F) | 'ワ' (U+FF9C) | +---------+--------------------------------+--------------------------------+ | | 'を' (U+3092) | 'ヲ' (U+FF66) | +---------+--------------------------------+--------------------------------+ | | 'ん' (U+3093) | 'ン' (U+FF9D) | +---------+--------------------------------+--------------------------------+ | | 'ゔ' (U+3094) | 'ヴ' (U+FF73 U+FF9E) | +---------+--------------------------------+--------------------------------+ .. table:: 全角カタカナ→ひらがな :align: center +---------+--------------------------------+--------------------------------+ | 種別 | 全角カタカナ | ひらがな | +=========+================================+================================+ | ... | 'ァ' (U+30A1) ~ 'ヶ' (U+30F6) | 'ぁ' (U+3041) ~ 'ゖ' (U+3096) | +---------+--------------------------------+--------------------------------+ | | 'ヽ' (U+30FD) ~ 'ヾ' (U+30FE) | 'ゝ' (U+309D) ~ 'ゞ' (U+309E) | +---------+--------------------------------+--------------------------------+