From: Koichi KAMICHI Date: Wed, 29 Nov 2006 14:13:02 +0000 (+0000) Subject: Created new hash table for `feature', and deprecated two arrays. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=7fa78d325fc0827de1532ba845483b0ab98c8ea2;p=chise%2Fkage.git Created new hash table for `feature', and deprecated two arrays. --- diff --git a/tools/chiseperl.pl b/tools/chiseperl.pl index cef353a..d32a0d7 100755 --- a/tools/chiseperl.pl +++ b/tools/chiseperl.pl @@ -2,7 +2,8 @@ # # Copyright (C) 2005,2006 KAMICHI Koichi. # -# global : $chise_ds, @chise_feature, @chise_ft, $chise_newid +# global : $chise_ds, %chise_feature, $chise_newid +# (deprecated: @chise_feature, @chise_ft) # function : void init_chise(); # void close_chise(); # void update_chise(); @@ -18,11 +19,21 @@ sub init_chise{ $chise_ds = chise::CHISE_DS_open($chise::CHISE_DS_Berkeley_DB, $chise::chise_system_db_dir, 0, 0755); chise::listup_feature($chise_ds); - @chise_feature = split(/\n/, chise::get_char($chise::feature)); - @chise_ft = (); - foreach(@chise_feature){ - push(@chise_ft, chise::chise_ds_get_feature($chise_ds, chise::get_uchar($_))); + # deprecated begin + #@chise_feature = split(/\n/, chise::get_char($chise::feature)); + #@chise_ft = (); + #foreach(@chise_feature){ + # push(@chise_ft, chise::chise_ds_get_feature($chise_ds, chise::get_uchar($_))); + # $chise_ft{$_} = chise::chise_ds_get_feature($chise_ds, chise::get_uchar($_)); + #} + # deprecated end + my @temp = split(/\n/, chise::get_char($chise::feature)); + %chise_feature = (); + foreach(@temp){ + $chise_feature{$_} = chise::chise_ds_get_feature($chise_ds, chise::get_uchar($_)); } + @chise_feature = keys(%chise_feature); + @chise_ft = values(%chise_feature); $chise_newid = 0x0F0000; }