Jul 19, 2012, 7:51 AM
Post #1 of 4
As you can see from the perl code snippets below, I am putting the $document string (which contains text from a text document) into an @document array. Then printing out $document before stemming it. I am them stemming the @document array and then I am trying to print out the $stemmed_words_anon_array string and I get: "ARRAY(0xc99b3c)" which is like a memory address. What am I doing wrong?? My results_stemmed.txt also contains the ARRAY(0xc99b3c) inside it.
Trying to stem having issue with array
# Put string of main document into an array
my @document = split(' ', $document);
# Print the $document string to check it before stemming it
open (FILE_STEM, '>results_stemmed.txt');
use Lingua::Stem qw(stem);
my $stemmed_words_anon_array = stem(@document);
# $stemmed_words_anon_array is just receiving: ARRAY(0xcbacb) or something similar...why?
print FILE_STEM $stemmed_words_anon_array;