X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=Chise_utils%2FChise_utils.pm;h=1c2aca0d843a10d4c382c17c139ae8afba81d910;hb=a5b67490dec3829a2f7bf6deee47d9a2b8a9020c;hp=8414736a0ef1cdcb4c9790d48b75a1b4c9da78ec;hpb=7439d4b3ddafa248e1d9a1d5ea630aabef40a081;p=chise%2Fperl.git diff --git a/Chise_utils/Chise_utils.pm b/Chise_utils/Chise_utils.pm index 8414736..1c2aca0 100644 --- a/Chise_utils/Chise_utils.pm +++ b/Chise_utils/Chise_utils.pm @@ -193,8 +193,9 @@ sub get_chars_matching{ } } else{ -# # fall back if DB inconsistency exists. +# never fall back. # unless(@res){ +# # fall back if DB inconsistency exists. if(&get_db($atr)){ foreach $char (keys %{$chardb{$atr}}){ if($chardb{$atr}->{$char} eq $value){ @@ -227,18 +228,14 @@ sub get_chars_for{ } } } - foreach (keys %res){ - if($res{$_}==$i){ - push @res,$_; - } - } - return @res; + return grep {defined($res{$_}) and $res{$_}==$i} (keys %res); } sub de_er{ my($er)=@_; my($output_char,$atr,$value); if($er=~/^\d+$/){ + # only for debug. $output_char=pack("U",$er); }elsif($er=~/^U[\+\-]([a-fA-F\d]+)/){ $output_char=pack("U",hex($1));