examples/term2desc
raw| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | use FindBin qw($Bin); |
| 4 | use lib "$Bin/../lib"; |
| 5 | |
| 6 | if (@ARGV < 2) { |
| 7 | print "Usage: apply_rules <rule source file> <thesaurus source file>\n"; |
| 8 | exit 1; |
| 9 | } |
| 10 | |
| 11 | use Biblio::Thesaurus; |
| 12 | use Biblio::Thesaurus::ModRewrite; |
| 13 | |
| 14 | my $code = <<"EOF"; |
| 15 | $ARGV[0] \$r \$t => sub { print "\$r \$t<br>"; }. |
| 16 | EOF |
| 17 | |
| 18 | my $obj = thesaurusLoad($ARGV[1]); |
| 19 | $t = Biblio::Thesaurus::ModRewrite->new($obj); |
| 20 | |
| 21 | print "$ARGV[0]<br>"; |
| 22 | $t->process($code); |