git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
svn 2014-10-06 01:27:43 +00:00
Родитель 33447b80d5
Коммит cc8a255d25
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -20,9 +20,9 @@ class Array
def line_slice (new_line) # joins items, 16 items per line
each_slice(16).collect(&:join).join new_line
end
def to_UTF8() collect(&:to_UTF8).join end
def to_regexp_chars # converts an array of Integers to character ranges
sort.inject([]) do |ranges, value|
if ranges.last and ranges.last[1]+1>=value
@ -64,7 +64,7 @@ CombiningClass = {} # constant to allow use in Integer#to_UTF8
# read the file 'UnicodeData.txt'
IO.foreach("../data/UnicodeData.txt") do |line|
codepoint, name, _2, char_class, _4, decomposition, *_rest = line.split(";")
case decomposition
when /^[0-9A-F]/
decomposition_table[codepoint.hex] = decomposition.split(' ').collect(&:hex)
@ -72,7 +72,7 @@ IO.foreach("../data/UnicodeData.txt") do |line|
kompatible_table[codepoint.hex] = decomposition.split(' ').drop(1).collect(&:hex)
end
CombiningClass[codepoint.hex] = char_class.to_i if char_class != "0"
if name=~/(First|Last)>$/ and (char_class!="0" or decomposition!="")
warn "Unexpected: Character range with data relevant to normalization!"
end