
demisheep
New User
Jul 19, 2012, 7:51 AM
Post #1 of 4
(2702 views)
|
Trying to stem having issue with array
|
Can't Post
|
|
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.
# Put string of main document into an array my @document = split(' ', $document); # # Print the $document string to check it before stemming it print $document; # 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; close(FILE_STEM); print $stemmed_words_anon_array;
|