From: Martin Mares Date: Sat, 11 Oct 2003 08:58:12 +0000 (+0000) Subject: Renamed mkunacc to gen-unacc. X-Git-Tag: holmes-import~1199 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=de2709d6ae8c758c0be66edaa5888b3426120097;p=libucw.git Renamed mkunacc to gen-unacc. --- diff --git a/charset/misc/gen-unacc b/charset/misc/gen-unacc new file mode 100755 index 00000000..8853b7e5 --- /dev/null +++ b/charset/misc/gen-unacc @@ -0,0 +1,35 @@ +#!/usr/bin/perl +# +# Create Unicode Unaccenting Table +# (c) 1997 Martin Mares +# + +open (UNI, "unicode/UnicodeData.txt") || die "No Unicode Data File"; +while () { + chomp; + ($num,$name,$cat,$_,$_,$exp) = split /;/; + if ($cat =~ /^L[ul]$/) { $letter{$num} = 1; } + if ($cat =~ /^Mn$/) { $accent{$num} = 1; } +} +close UNI; + +open (UNI, "unicode/UnicodeData.txt") || die "No Unicode Data File"; +while () { + chomp; + ($num,$name,$cat,$_,$_,$exp) = split /;/; + $num =~ /^....$/ || next; + if ($exp ne "") { + $exp =~ s/^<.*> *//g; + $good = 1; + $e = ""; + foreach $a (split(/\s+/, $exp)) { + if ($accent{$a}) { } + elsif ($letter{$a}) { + if ($e ne "") { $good = 0; } + else { $e = $a; } + } else { $good = 0; } + } + if ($good && $e ne "") { print "$num\t0x$e\n"; } + } +} +close UNI; diff --git a/charset/misc/mkunacc b/charset/misc/mkunacc deleted file mode 100644 index 8853b7e5..00000000 --- a/charset/misc/mkunacc +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/perl -# -# Create Unicode Unaccenting Table -# (c) 1997 Martin Mares -# - -open (UNI, "unicode/UnicodeData.txt") || die "No Unicode Data File"; -while () { - chomp; - ($num,$name,$cat,$_,$_,$exp) = split /;/; - if ($cat =~ /^L[ul]$/) { $letter{$num} = 1; } - if ($cat =~ /^Mn$/) { $accent{$num} = 1; } -} -close UNI; - -open (UNI, "unicode/UnicodeData.txt") || die "No Unicode Data File"; -while () { - chomp; - ($num,$name,$cat,$_,$_,$exp) = split /;/; - $num =~ /^....$/ || next; - if ($exp ne "") { - $exp =~ s/^<.*> *//g; - $good = 1; - $e = ""; - foreach $a (split(/\s+/, $exp)) { - if ($accent{$a}) { } - elsif ($letter{$a}) { - if ($e ne "") { $good = 0; } - else { $e = $a; } - } else { $good = 0; } - } - if ($good && $e ne "") { print "$num\t0x$e\n"; } - } -} -close UNI;