This creates the databases required by Omega/CHISE.
EOF
-#my $cmapdir="/usr/local/share/texmf/dvipdfm/CMap";
-#my $db_home="$HOME/.chise";
+#my $cmapdir="/usr/local/share/texmf/dvipdfm/CMap-AcrobatReader5.0";
+#my $db_home="./omegadb";
if(@ARGV==2){
$cmapdir=shift;
$db_home=shift;
if(/<([\da-fA-F]+)>\s*<([\da-fA-F]+)>\s*(\d+)/){
($from, $to, $cid) = (hex($1), hex($2), $3);
while ($from <= $to) {
- $cid{$target}->{$cid++}=$from++;
+ # DB¤Î¥Þ¥Ã¥Ô¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë¤Ê¤¤¤Î¤Ëcid¤¬¤¢¤ë¾ì¹ç¤Ï
+ # UCS ¤½¤Î¤Þ¤Þ¤Ç¤è¤¤¡©
+
+ if(defined($mapto{$target}->{$from})){
+ $charid=$mapto{$target}->{$from};
+ }else{
+ $charid=$from;
+ }
+ unless($ciddb{$target}->db_put($charid,$from)==0){
+ die $!;
+ }
+ $cid++,$from++;
}
}
}
print STDERR "done!\n";
}
-foreach $target (keys %cmaps){
- print STDERR "Storing data for Uni",uc($target),"...";
- foreach $cid (keys %{$cid{$target}}){
- # $cid{$target}->{$cid} ¢« ucs in UniJIS, etc.
- $ucs=$cid{$target}->{$cid};
- # DB¤Î¥Þ¥Ã¥Ô¥ó¥°¥Æ¡¼¥Ö¥ë¤Ë¤Ê¤¤¤Î¤Ëcid¤¬¤¢¤ë¾ì¹ç¤Ï
- # UCS ¤½¤Î¤Þ¤Þ¤Ç¤è¤¤¡©
- if(defined($mapto{$target}->{$ucs})){
- $charid=$mapto{$target}->{$ucs};
- }else{
- $charid=$ucs;
- }
- unless($ciddb{$target}->db_put($charid,$ucs)==0){
- die $!;
- }
- }
- print STDERR "done!\n";
-}
-
-# creating reverse ids DB.
+# creating ids DB.
my $idsdb_filename="idsdb";
my($idsdb,$ids);
if(-f "$db_home/$idsdb_filename"){