amadaeliseo
Instructor
I have used Text::NSP module and have found most frequent collocations in a text, and ended with this:
Something is wrong and it is not working. What? How to fix it?
Code:
$filename = "input.txt";
$outfile="output.txt";
open(INPUT,$filename) or die "Can't open file $filename\n";
open( OUTPUT, "> $outfile") or die "$filename: $!";
undef $/; my $text=<INPUT>; close INPUT; $/ = "\n";
$text =~ tr/a-zåàâäæçéèêëîïôöœßùûüÿA-ZÅÀÂÄÆÇÉÈÊËÎÏÔÖŒÙÛÜ/\n/cs;
@words = split(/\n/, $text);
use Text::NSP::Measures::2D::MI::ll;
my $npp = 60; my $n1p = 20; my $np1 = 20; my $n11 = 10;
$ll_value = calculateStatistic( n11=>$n11,
n1p=>$n1p,
np1=>$np1,
npp=>$npp);
if( ($errorCode = getErrorCode()))
{
print STDERR $errorCode." - ".getErrorMessage()."\n"";
}
else
{
print getStatisticName."value for bigram is ".$ll_value."\n"";
}
Something is wrong and it is not working. What? How to fix it?