#!/usr/local/bin/perl
#
#  nitamogy -- replace characters with nita mogy.
#  Mon Aug 14 19:10:02 2000 daiti-m@is.aist-nara.ac.jp
#  Revised Sat Sep 30 15:30:47 2000, thanks to itogawa.
#
use I18N::Japanese;

while (<DATA>)
{
    my ($source, $replace) = split;
    $nitamogy{$source} = $replace;
    $nitamogy{$replace} = $source;
}

my $regex = join '|', sort { length($b) <=> length($a) } keys %nitamogy;

while (<>)
{
    s/($regex)/$nitamogy{$1}/g;
    print;
}

__END__
カ 力
タ 夕
ロ 口
エ 工
..
以下規則
