#!/usr/bin/perl # # Create Word Signature Table # (c) 1997 Martin Mares # open (U, "misc/u-upper") || die "No uppercase map"; while () { chomp; /^(....)\t0x(....)$/ || die "Syntax error"; $upper{$1} = $2; } close U; open (U, "misc/u-unacc") || die "No unaccent map"; while () { chomp; /^(....)\t0x(....)$/ || die "Syntax error"; $unacc{$1} = $2; } close U; open (U, "set/sig") || die "No signature set"; while () { chomp; /^(..)\t(....)\t/ || next; $sigset{$2} = $1; } close U; open (U, "misc/u-cat") || die "No category map"; while () { chomp; /^(....)\t/ || die "Syntax error"; $from = $1; /_C_(UPPER|LOWER)/ || next; $to = (defined $upper{$from}) ? $upper{$from} : $from; $to = (defined $unacc{$to}) ? $unacc{$to} : $to; if (defined $sigset{$to}) { print "$from\t0x$sigset{$to}\n"; } }