5 use vars qw($atr $value $char
6 $opt_map $opt_mapfrom $opt_mapto
7 $opt_atr $opt_allatr $opt_showatr
11 use Chise_utils ':all';
14 Usage: perl $0 [-m <map> | --map <map> |
20 -a=<atribuite> <char> |
24 total-strokes==8 means
25 the attribute of total-strokes exactly matches to 8.
27 the attribute of ids-parts contains the string 矢.
28 total-strokes==8,ids-parts=~矢 means both at the same time.
29 -a get <attribute> of <char>
30 -aa get all attributes of <char>
33 &GetOptions("mapto=s"=>\$opt_mapto,
34 "mapfrom=s"=>\$opt_mapfrom,
38 "show-attribute"=>\$opt_showatr,
44 or !((($opt_map or $opt_mapfrom or $opt_mapto) and @ARGV==0)
45 or($opt_showatr and @ARGV==0)
52 $char=shift or $char="";
56 $opt_map="<=".$opt_mapfrom;
58 $opt_map="=>".$opt_mapto;
62 if(defined(%{$chardb{$opt_map}})){
63 foreach $char (sort keys %{$chardb{$opt_map}}){
64 if($chardb{$opt_map}->{$char}){
65 print $char,"\t",$chardb{$opt_map}->{$char},"\n";
69 print STDERR "No map for $opt_map.\n";
72 $char=&de_er($char) if($char=~/\d/);
74 foreach $atr (sort keys %db){
75 if($chardb{$atr}->{"?$char"}){
76 print " ",$atr,":",$chardb{$atr}->{"?$char"},"\n";
80 $char=&de_er($char) if($char=~/\d/);
82 print " ",$opt_atr,":",&get_char_attribute($char,$opt_atr),"\n";
84 foreach $atr (sort keys %db){
89 print join "\n",&get_chars_for($query),"\n";