Skip to content

Instantly share code, notes, and snippets.

@matstani
Last active March 29, 2016 05:47
Show Gist options
  • Select an option

  • Save matstani/fce3d3af36a0859a6a5b to your computer and use it in GitHub Desktop.

Select an option

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