Sha256: 5c65b1a6f79de6c3f287259c25fda77ba34fd74948011ba5c46ff529b79192df

Contents?: true

Size: 496 Bytes

Versions: 1

Compression:

Stored size: 496 Bytes

Contents

# encoding: utf-8

require 'nkf'
require 'conv_ja_char/version'

module ConvJaChar
  class Normalization
    def self.kana(str)
      return '' unless str
      # -Z1         : convert from X0208 white sapce to ASCII white space
      # -X          : convert from X0201 half-size katanaka to X0208 full-size katakana
      # -w          : output UTF-8 without BOM
      # --katakana  : convert from hiragana to katakana
      NKF.nkf('-Z1 -X -w --katakana', "#{str}").downcase
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
conv_ja_char-0.0.1 lib/conv_ja_char/normalization.rb