README.markdown in gimchi-0.1.7 vs README.markdown in gimchi-0.1.8
- old
+ new
@@ -32,34 +32,49 @@
ko.korean_char? 'ㅏ' # true
ko.complete_korean_char? 'ㅏ' # false
ko.korean_char? '가' # true
ko.complete_korean_char? '가' # true
+
+# Shorthand of korean_char?
+ko.kchar? '가' # true
```
### Usage of Gimchi::Korean::Char
```ruby
-arr = ko.dissect '이것은 한글입니다.'
- # [이, 것, 은, " ", 한, 글, 입, 니, 다, "."]
+kc = ko.kchar "한"
+kc.class # Gimchi::Korean::Char
-arr[4].class # Gimchi::Korean::Char
+kc.chosung # "ㅎ"
+kc.jungsung # "ㅏ"
+kc.jongsung # "ㄴ"
+kc.to_a # ["ㅎ", "ㅏ", "ㄴ"]
+kc.to_s # "한"
-arr[4].chosung # "ㅎ"
-arr[4].jungsung # "ㅏ"
-arr[4].jongsung # "ㄴ"
-arr[4].to_a # ["ㅎ", "ㅏ", "ㄴ"]
-arr[4].to_s # "한"
+kc.complete? # true
+kc.partial? # false
+ko.kchar("ㅏ").partial? # true
-arr[4].chosung = 'ㄷ'
-arr[4].jongsung = 'ㄹ'
-arr[4].to_s # "달"
-arr[4].complete? # true
-arr[4].partial? # false
+# Modifying its elements
+kc.chosung = 'ㄷ'
+kc.jongsung = 'ㄹ'
+kc.to_s # "달"
+kc.complete? # true
+kc.partial? # false
-arr[4].chosung = nil
-arr[4].jongsung = nil
-arr[4].complete? # false
-arr[4].partial? # true
+kc.chosung = nil
+kc.jongsung = nil
+kc.complete? # false
+kc.partial? # true
+
+# Alias of kchar
+kc = ko.korean_char "한"
+
+# Array of Gimchi::Korean::Char's
+arr = ko.dissect '이것은 한글입니다.'
+ # [이, 것, 은, " ", 한, 글, 입, 니, 다, "."]
+
+arr[0].class # Gimchi::Korean::Char
```
### Reading numbers in Korean
```ruby
ko.read_number(1999) # "천 구백 구십 구"