From 2700346d3c00c45915312d0a96cedc3a74b11459 Mon Sep 17 00:00:00 2001 From: imiyazaki Date: Sat, 1 Mar 2003 09:43:29 +0000 Subject: [PATCH] $idc added. &ids_argc added. &get_char_attribute changed. --- Chise_utils/Chise_utils.pm | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Chise_utils/Chise_utils.pm b/Chise_utils/Chise_utils.pm index 3338922..a2365d6 100644 --- a/Chise_utils/Chise_utils.pm +++ b/Chise_utils/Chise_utils.pm @@ -9,6 +9,7 @@ require Exporter; use utf8; use BerkeleyDB; use vars qw(%db %chardb $atr + $idc ); our @ISA = qw(Exporter); @@ -21,13 +22,14 @@ our @ISA = qw(Exporter); # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK # will save memory. our %EXPORT_TAGS = ( 'all' => [ qw( - %db %chardb + %db %chardb $idc &get_char_attribute &get_chars_matching &get_chars_containing &get_chars_matching &get_chars_for &de_er + &ids_argc ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); @@ -54,6 +56,8 @@ if(-e '/usr/local/lib/xemacs-21.4.10/i686-pc-linux/char-db/system-char-id'){ exit 1; } +$idc="[â¿°-â¿»]"; + for (<$DB_HOME/*>){ next if(/\.txt$/); $atr=$_; @@ -77,7 +81,7 @@ sub get_char_attribute{ if($chardb{$atr}->{"?$char"}){ return $chardb{$atr}->{"?$char"}; }else{ - return "no attribute for $char"; + return ""; } } @@ -87,6 +91,7 @@ sub get_chars_containing{ if(defined(%{$chardb{$atr}})){ foreach $char (keys %{$chardb{$atr}}){ if($chardb{$atr}->{$char}=~/$value/){ + $char=~s/^\?//; push @res,$char; } } @@ -99,7 +104,8 @@ sub get_chars_matching{ my($char,@res); if(defined(%{$chardb{$atr}})){ foreach $char (keys %{$chardb{$atr}}){ - if($chardb{$atr}->{$char}=~/^$value$/){ + if($chardb{$atr}->{$char} eq $value){ + $char=~s/^\?//; push @res,$char; } } @@ -165,6 +171,18 @@ sub de_er{ return $char; } +sub ids_argc{ + my($char)=@_; + my $char_id=unpack("U",$char); + if($char_id==0x2ff2 or $char_id==0x2ff3){ + return 3; + }elsif($char_id>=0x2ff0 and $char_id<=0x2fff){ + return 2; + }else{ + return 0; + } +} + # Autoload methods go after =cut, and are processed by the autosplit program. 1; -- 1.7.10.4