From 7439d4b3ddafa248e1d9a1d5ea630aabef40a081 Mon Sep 17 00:00:00 2001 From: imiyazaki Date: Sun, 19 Oct 2003 04:11:35 +0000 Subject: [PATCH] fix GT-K in %er_aliases. add $er_prefix_re to simplify codes. --- Chise_utils/Chise_utils.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Chise_utils/Chise_utils.pm b/Chise_utils/Chise_utils.pm index e63122d..8414736 100644 --- a/Chise_utils/Chise_utils.pm +++ b/Chise_utils/Chise_utils.pm @@ -77,7 +77,7 @@ my %er_alias = 'CB','=cbeta', 'CDP','=big5-cdp', 'GT','=gt', - 'GT-K','=gt', + 'GT-K','=gt-k', 'HZK1','=hanziku-1', 'HZK2','=hanziku-2', 'HZK3','=hanziku-3', @@ -100,6 +100,8 @@ my %er_alias = 'M','=daikanwa', ); +my $er_prefix_re=join '|', keys %er_alias; + if(-d "$DB_HOME/character"){ for (glob "$DB_HOME/character/feature/*"){ next if(/\.txt$/); @@ -236,12 +238,11 @@ sub get_chars_for{ sub de_er{ my($er)=@_; my($output_char,$atr,$value); - my $keys = join '|', keys %er_alias; if($er=~/^\d+$/){ $output_char=pack("U",$er); }elsif($er=~/^U[\+\-]([a-fA-F\d]+)/){ $output_char=pack("U",hex($1)); - }elsif($er=~/(?:I\-)?($keys)\-?([0-9a-fA-F]+)/){ + }elsif($er=~/(?:I\-)?($er_prefix_re)\-?([0-9a-fA-F]+)/){ ($atr,$value)=($1,$2); unless($er_alias{$atr}=~/daikanwa|gt/){ $value=hex($value); -- 1.7.10.4