Module: Gimchi::Char::Component

Defined in:
lib/gimchi/char.rb

Overview

Three components of Gimchi::Char are extended to support #vowel? and #consonant? method.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#korKorean

Returns Hosting Korean instance.

Returns:

  • (Korean)

    Hosting Korean instance



98
99
100
# File 'lib/gimchi/char.rb', line 98

def kor
  @kor
end

Instance Method Details

#consonant?Boolean

Is this component a consonant?

Returns:

  • (Boolean)


106
107
108
# File 'lib/gimchi/char.rb', line 106

def consonant?
  self != '' && kor.chosung?(self)
end

#vowel?Boolean

Is this component a vowel?

Returns:

  • (Boolean)


101
102
103
# File 'lib/gimchi/char.rb', line 101

def vowel?
  kor.jungsung? self
end