以下のPerlコードスニペットからわかるように、$document
文字列(テキストドキュメントのテキストを含む)を@document
配列に入れています。$document
次に、それをステミングする前に印刷します。次に、配列をステミングし、ステミングされた結果が文字列@document
に入れられますが、次のようになります。これはメモリアドレスのようなものです。$stemmed_words_anon_array
ARRAY(0xc99b3c)
私は何が間違っているのですか?私results_stemmed.txt
もそのARRAY(0xc99b3c)
中に含まれています。
# 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) here
print FILE_STEM $stemmed_words_anon_array;
close(FILE_STEM);
print $stemmed_words_anon_array;