Created
March 16, 2014 17:33
-
-
Save mikesorae/9586882 to your computer and use it in GitHub Desktop.
全角カナ→半角カナ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nkf' | |
# 既存の半角は維持しつつ全角カナを半角に変換 | |
ARGF.each do |line| | |
# -xを付けないと既存の半角カナが全角になるぽい | |
puts NKF.nkf('-xw -Z4', line) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment