--- perlindex-1.401/lib/Text/English.pm- 2005-04-10 12:31:22 +0400 +++ perlindex-1.401/lib/Text/English.pm 2005-07-17 05:49:05 +0400 @@ -5,8 +5,13 @@ # Language : CPerl package Text::English; +$VERSION = '0.02'; -$VERSION = $VERSION = '0.01'; +require Exporter; +@ISA = qw(Exporter); +@EXPORT_OK = qw(stem); + +use strict; sub stem { my @parms = @_; --- perlindex-1.401/perlindex.PL- 2005-07-17 05:49:05 +0400 +++ perlindex-1.401/perlindex.PL 2005-07-17 05:50:40 +0400 @@ -63,7 +63,7 @@ use Fcntl; use less 'time'; use Getopt::Long; use File::Basename; -use Text::English; +use Text::English 0.02 qw(stem); use Config; # NDBM_File as LAST resort @@ -110,17 +110,6 @@ if (eval 'require Term::ReadKey') { $BSD_STYLE= 0; } -# # Let's look for a stemmer -# eval "use Text::English;"; -# unless ($@) { -# $stemmer = \&Text::English::stem; -# } else { -# eval "require 'Stem.pl';"; -# unless ($@) { -# $stemmer = \&stem; -# } -# } - # In the following, perl variables are not expanded during extraction. print OUT <<'!NO!SUBS!'; @@ -132,7 +121,6 @@ if ($Config{'osname'} eq 'hpux') { if (exists $ENV{PAGER}) { $pager=$ENV{PAGER} } -$stemmer = \&Text::English::stem; $opt_index = ''; # make perl -w happy $opt_menu = 1; @@ -286,11 +274,7 @@ sub normalize { for $word (split ' ', $line ) { $word =~ s/^\d+//; next unless length($word) > 2; - if ($stemmer) { - push @result, &$stemmer($word); - } else { - push @result, $word; - } + push @result, stem($word); } @result; }