9 overload::constant ( 'qr' => \&ChiseLikeRegex )
13 overload::remove_constant
16 # データベースの場を指。いずれはlibchiseに...
17 # データベースの全ファイルをchownしないとえないかも
19 if (-e '/usr/local/lib/chise/char-db') {
20 $DB_HOME = '/usr/local/lib/chise/char-db';
21 } elsif (-e '/sw/lib/xemacs-21.4.11/powerpc-apple-darwin6.6/char-db') {
22 $DB_HOME = '/sw/lib/xemacs-21.4.11/powerpc-apple-darwin6.6/char-db';
23 } elsif (-e '/usr/local/lib/xemacs-21.4.11/i686-pc-linux/char-db') {
24 $DB_HOME = '/usr/local/lib/xemacs-21.4.11/i686-pc-linux/char-db';
25 } elsif (-e '/usr/local/lib/xemacs-21.4.11/powerpc-apple-darwin6.4/char-db') {
26 $DB_HOME = '/usr/local/lib/xemacs-21.4.11/powerpc-apple-darwin6.4/char-db';
27 } elsif (-e '/usr/local/xemacs-utf2000/lib/xemacs-21.4.11/powerpc-apple-darwin6.4/char-db'){
28 $DB_HOME = '/usr/local/xemacs-utf2000/lib/xemacs-21.4.11/powerpc-apple-darwin6.4/char-db';
29 } elsif (-e '/usr/local/lib/xemacs-21.4.10/i686-pc-linux/char-db') {
30 $DB_HOME = '/usr/local/lib/xemacs-21.4.10/i686-pc-linux/char-db';
31 } elsif (-e '/usr/local/lib/xemacs-21.4.10/powerpc-apple-darwin6.4/char-db') {
32 $DB_HOME = '/usr/local/lib/xemacs-21.4.10/powerpc-apple-darwin6.4/char-db';
33 } elsif (-e '/usr/local/xemacs-utf2000/lib/xemacs-21.4.10/powerpc-apple-darwin6.4/char-db'){
34 $DB_HOME = '/usr/local/xemacs-utf2000/lib/xemacs-21.4.10/powerpc-apple-darwin6.4/char-db';
35 } elsif (-e 'd:/work/chise/char-db'){
36 $DB_HOME = 'd:/work/chise/char-db';
38 print STDERR "CHISE.pm: No database found.\n";
39 print STDERR "CHISE.pm: Please set \$DB_HOME to CHISE.pm.\n";
43 #--- 正規表現のCHISE的拡張 ------------------------------------#
45 sub ChiseLikeRegex ($) {
47 my ($RegexLiteral) = @_;
48 #print STDERR "BEFORE: $RegexLiteral\n"; # for debug
50 =~ s/\\same_([^_]+)_(\d)/(??{CHISE_REG->chise_backref(\$$2,'$1')})/g;
51 #print STDERR "AFTER: $RegexLiteral\n"; # for debug
57 my ($backreference, $feature_name) = @_;
58 #print STDERR "backreference: $backreference\n"; # for debug
59 #print STDERR "feature name: $feature_name\n"; # for debug
60 my $result = `./chisereg.pl $backreference $DB_HOME $feature_name`;
61 print STDERR $result, "\n"; # for debug