method

hangul_comp_one

Importance_0
v2_5_5 - Show latest stable - 0 notes - Class: UnicodeNormalize
hangul_comp_one(string) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/unicode_normalize/normalize.rb, line 67
  def self.hangul_comp_one(string)
    length = string.length
    if length>1 and 0 <= (lead =string[0].ord-LBASE) and lead  < LCOUNT and
                    0 <= (vowel=string[1].ord-VBASE) and vowel < VCOUNT
      lead_vowel = SBASE + (lead * VCOUNT + vowel) * TCOUNT
      if length>2 and 0 <= (trail=string[2].ord-TBASE) and trail < TCOUNT
        (lead_vowel + trail).chr(Encoding::UTF_8) + string[3..-1]
      else
        lead_vowel.chr(Encoding::UTF_8) + string[2..-1]
      end
    else
      string
    end
  end
Register or log in to add new notes.