Subject: | Cease stripping of empty array elements |
Regarding Lingua::Stem::Snowball version 0.92...
If the arrayref you feed to the English stemmer starts/ends with either undef values or empty strings, the return array will have fewer elements than the source array. This makes mapping from source to output more involved. It would be preferable if the blank elements did not get stripped.
#!/usr/bin/perl
use strict;
use warnings;
use Lingua::Stem::Snowball;
my $stemmer = Lingua::Stem::Snowball->new( lang => 'en' );
my @stemmable = ('', undef, 'foo', 'bar', '' );
my @stemmed = $stemmer->stem(\@stemmable);
print "@stemmed\n";
print "Source elements: " . scalar @stemmable . "\n";
print "Stemmed elements: " . scalar @stemmed . "\n";