lib/gimchi/korean.rb in gimchi-0.1.7 vs lib/gimchi/korean.rb in gimchi-0.1.8
- old
+ new
@@ -54,10 +54,11 @@
raise ArgumentError.new('Lengthy input') if ch.length > 1
complete_korean_char?(ch) ||
(chosungs + jungsungs + jongsungs).include?(ch)
end
+ alias kchar? korean_char?
# Checks if the given character is a "complete" korean character.
# "Complete" Korean character must have chosung and jungsung, with optional jongsung.
# @param [String] ch A string of size 1
def complete_korean_char? ch
@@ -73,9 +74,17 @@
def dissect str
str.each_char.map { |c|
korean_char?(c) ? Korean::Char.new(self, c) : c
}
end
+
+ # Returns a Korean::Char object for the given Korean character.
+ # @param [String] ch Korean character in String
+ # @return [Korean::Char] Korean::Char instance
+ def kchar ch
+ Korean::Char.new(self, ch)
+ end
+ alias korean_char kchar
# Reads numeric expressions in Korean way.
# @param [String, Number] str Numeric type or String containing numeric expressions
# @return [String] Output string
def read_number str