Sha256: f57d9b7893b7e2b54a4f15d3954918206f69a707940b7f712eaca3b3b092daa0

Contents?: true

Size: 386 Bytes

Versions: 1

Compression:

Stored size: 386 Bytes

Contents

#coding:UTF-8
require 'nkf'
require 'jcode' if RUBY_VERSION < "1.9"

module SFCRoom::Utils
  def self.greek_downcase str
    str.tr('Α-Ω','α-ω')
  end
  def self.greek_upcase str
    str.tr('α-ω','Α-Ω')
  end
  def self.hankaku_zenkaku str
    NKF::nkf('-Z1 -Ww',str)
  end

  def self.convert_for_search str
    self.hankaku_zenkaku self.greek_downcase(str).downcase
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sfc-room-0.0.1 lib/sfc-room/utils.rb