method
nfc_one

v2_5_5 -
Show latest stable
-
0 notes -
Class: UnicodeNormalize
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
nfc_one(string)
public
Hide source
# File lib/unicode_normalize/normalize.rb, line 102 def self.nfc_one(string) nfd_string = nfd_one string start = nfd_string[0] last_class = CLASS_TABLE[start]-1 accents = '' nfd_string[1..-1].each_char do |accent| accent_class = CLASS_TABLE[accent] if last_class<accent_class and composite = COMPOSITION_TABLE[start+accent] start = composite else accents << accent last_class = accent_class end end hangul_comp_one(start+accents) end