mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
tool/unicode_norm_gen.rb: Adding/tweaking comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
42b382841c
commit
daea1a5f3a
2 changed files with 12 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Mon Oct 6 11:21:21 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||||
|
|
||||||
|
* tool/unicode_norm_gen.rb: Adding/tweaking comments.
|
||||||
|
|
||||||
Mon Oct 6 10:57:57 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
|
Mon Oct 6 10:57:57 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||||
|
|
||||||
* tool/unicode_norm_gen.rb: Adjusted directory paths.
|
* tool/unicode_norm_gen.rb: Adjusted directory paths.
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
# Copyright 2010-2013 Ayumu Nojima (野島 歩) and Martin J. Dürst (duerst@it.aoyama.ac.jp)
|
# Copyright 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)
|
|
||||||
|
|
||||||
|
# Script to generate Ruby data structures used in implementing
|
||||||
|
# String#unicode_normalize,...
|
||||||
|
|
||||||
|
# Constants for input and ouput directory
|
||||||
InputDataDir = '../enc/unicode/data'
|
InputDataDir = '../enc/unicode/data'
|
||||||
OuputDataDir = '../lib/unicode_normalize'
|
OuputDataDir = '../lib/unicode_normalize'
|
||||||
|
|
||||||
|
# convenience methods
|
||||||
class Integer
|
class Integer
|
||||||
def to_UTF8()
|
def to_UTF8() # convert to string, taking legibility into account
|
||||||
if self>0xFFFF
|
if self>0xFFFF
|
||||||
"\\u{#{to_s(16).upcase}}"
|
"\\u{#{to_s(16).upcase}}"
|
||||||
elsif CombiningClass[self] or self=='\\'.ord or self=='"'.ord
|
elsif CombiningClass[self] or self=='\\'.ord or self=='"'.ord
|
||||||
|
@ -135,7 +138,7 @@ end.line_slice "\n "
|
||||||
open("#{OuputDataDir}/normalize_tables.rb", "w").print <<MAPPING_TABLE_FILE_END
|
open("#{OuputDataDir}/normalize_tables.rb", "w").print <<MAPPING_TABLE_FILE_END
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
# automatically generated by generate.rb
|
# automatically generated by tool/unicode_norm_gen.rb
|
||||||
|
|
||||||
module Normalize
|
module Normalize
|
||||||
ACCENTS = "
|
ACCENTS = "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue