diff --git a/ChangeLog b/ChangeLog index 9e3670093c..88566a807a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Oct 6 11:21:21 2014 Martin Duerst + + * tool/unicode_norm_gen.rb: Adding/tweaking comments. + Mon Oct 6 10:57:57 2014 Martin Duerst * tool/unicode_norm_gen.rb: Adjusted directory paths. diff --git a/tool/unicode_norm_gen.rb b/tool/unicode_norm_gen.rb index 03a32bbdc5..c90b16dac5 100644 --- a/tool/unicode_norm_gen.rb +++ b/tool/unicode_norm_gen.rb @@ -1,14 +1,17 @@ # coding: utf-8 -# Copyright 2010-2013 Ayumu Nojima (野島 歩) and Martin J. Dürst (duerst@it.aoyama.ac.jp) -# available under the same licence as Ruby itself -# (see http://www.ruby-lang.org/en/LICENSE.txt) +# Copyright Ayumu Nojima (野島 歩) and Martin J. Dürst (duerst@it.aoyama.ac.jp) +# Script to generate Ruby data structures used in implementing +# String#unicode_normalize,... + +# Constants for input and ouput directory InputDataDir = '../enc/unicode/data' OuputDataDir = '../lib/unicode_normalize' +# convenience methods class Integer - def to_UTF8() + def to_UTF8() # convert to string, taking legibility into account if self>0xFFFF "\\u{#{to_s(16).upcase}}" elsif CombiningClass[self] or self=='\\'.ord or self=='"'.ord @@ -135,7 +138,7 @@ end.line_slice "\n " open("#{OuputDataDir}/normalize_tables.rb", "w").print <