【发布时间】:2012-10-23 12:29:28
【问题描述】:
如何打印 $stopwords?它似乎是一个字符串 ($),但是当我打印它时,我得到:“HASH(0x8B694)”,每次运行时内存地址都会发生变化。
我正在使用 Lingua::StopWords,我只是想打印它正在使用的停用词,因此我可以确定有哪些停用词。我想把这两个打印成一个文件。
我需要以某种方式尊重 $stopwords 吗?
代码如下:
use Lingua::StopWords qw( getStopWords );
open(TEST, ">results_stopwords.txt") or die("Unable to open requested file.");
my $stopwords = getStopWords('en');
print $stopwords;
我试过了:
my @temp = $stopwords;
print "@temp";
但这不起作用。救命!
最后一点:我知道 Lingua::StopWords 有一个停用词列表,但我使用的是 (en),我只想确定我使用的是哪些停用词,这就是我想要的原因打印它,理想情况下我想将它打印到一个我应该已经知道如何做的文件部分。
【问题讨论】:
标签: string perl hash dereference