diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-20 11:50:00 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-20 11:50:00 +0000 |
commit | e64a3869bc8f76023f92a2c203877c6d534d099f (patch) | |
tree | b1eb580e2dc16fd06150f794a05b825eac4aa704 /lib/unicode_normalize | |
parent | 27cbf1f50d28f916d7a0157a2cac0d8e2acec1e2 (diff) |
unicode_normalize/normalize.rb: rename variable
* lib/unicode_normalize/normalize.rb (hangul_decomp_one): use more
descriptive name. leave [SLVT]BASE and [LVTNS]COUNT as they are
vague names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/unicode_normalize')
-rw-r--r-- | lib/unicode_normalize/normalize.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/unicode_normalize/normalize.rb b/lib/unicode_normalize/normalize.rb index 8bc8c6f607..bd53078c33 100644 --- a/lib/unicode_normalize/normalize.rb +++ b/lib/unicode_normalize/normalize.rb @@ -43,11 +43,11 @@ module UnicodeNormalize ## Hangul Algorithm def self.hangul_decomp_one(target) - sIndex = target.ord - SBASE - return target if sIndex < 0 || sIndex >= SCOUNT - l = LBASE + sIndex / NCOUNT - v = VBASE + (sIndex % NCOUNT) / TCOUNT - t = TBASE + sIndex % TCOUNT + syllable_index = target.ord - SBASE + return target if syllable_index < 0 || syllable_index >= SCOUNT + l = LBASE + syllable_index / NCOUNT + v = VBASE + (syllable_index % NCOUNT) / TCOUNT + t = TBASE + syllable_index % TCOUNT (t==TBASE ? [l, v] : [l, v, t]).pack('U*') + target[1..-1] end |