以下のPerlコードスニペットからわかるように、$document文字列(テキストドキュメントのテキストを含む)を@document配列に入れています。$document次に、それをステミングする前に印刷します。次に、配列をステミングし、ステミングされた結果が文字列@documentに入れられますが、次のようになります。これはメモリアドレスのようなものです。$stemmed_words_anon_arrayARRAY(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;