Skip to content

Instantly share code, notes, and snippets.

@matstani
Last active March 29, 2016 05:47
Show Gist options
  • Save matstani/fce3d3af36a0859a6a5b to your computer and use it in GitHub Desktop.
Save matstani/fce3d3af36a0859a6a5b to your computer and use it in GitHub Desktop.
clojure 全角カナ-半角カナ map
(def katakana-hannkakukatakana-map
{"ア" "ア" "イ" "イ" "ウ" "ウ" "エ" "エ" "オ" "オ"
"カ" "カ" "キ" "キ" "ク" "ク" "ケ" "ケ" "コ" "コ"
"サ" "サ" "シ" "シ" "ス" "ス" "セ" "セ" "ソ" "ソ"
"タ" "タ" "チ" "チ" "ツ" "ツ" "テ" "テ" "ト" "ト"
"ナ" "ナ" "ニ" "ニ" "ヌ" "ヌ" "ネ" "ネ" "ノ" "ノ"
"ハ" "ハ" "ヒ" "ヒ" "フ" "フ" "ヘ" "ヘ" "ホ" "ホ"
"マ" "マ" "ミ" "ミ" "ム" "ム" "メ" "メ" "モ" "モ"
"ヤ" "ヤ" "ユ" "ユ" "ヨ" "ヨ"
"ラ" "ラ" "リ" "リ" "ル" "ル" "レ" "レ" "ロ" "ロ"
"ワ" "ワ" "ヲ" "ヲ" "ン" "ン"
"ァ" "ァ" "ィ" "ィ" "ゥ" "ゥ" "ェ" "ェ" "ォ" "ォ"
"ャ" "ャ" "ュ" "ュ" "ョ" "ョ"
"ッ" "ッ"
"ガ" "ガ" "ギ" "ギ" "グ" "グ" "ゲ" "ゲ" "ゴ" "ゴ"
"ザ" "ザ" "ジ" "ジ" "ズ" "ズ" "ゼ" "ゼ" "ゾ" "ゾ"
"ダ" "ダ" "ヂ" "ヂ" "ヅ" "ヅ" "デ" "デ" "ド" "ド"
"バ" "バ" "ビ" "ビ" "ブ" "ブ" "ベ" "ベ" "ボ" "ボ"
"パ" "パ" "ピ" "ピ" "プ" "プ" "ペ" "ペ" "ポ" "ポ"
"ヴ" "ヴ"})
(->> (map (fn [c] (or (katakana-hannkakukatakana-map (str c))
c))
"アイウエオカキクケコガキグゲゴパピプペポ")
(apply str))
; "アイウエオカキクケコガキグゲゴパピプペポ"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment