Text::NSP::Measures::3D is a Perl module that provides basic framework for building measure of association for trigrams.
This module can be used as a foundation for building 3-dimensional measures of association that can then be used by statistic.pl. In particular this module provides methods that give convenient access to 3-d (i.e., trigram) frequency counts as created by count.pl, as well as some degree of error handling that verifies the data.
$ll_value = calculateStatistic( n111=>10,
if( ($errorCode = getErrorCode()))
print STDERR $erroCode." - ".getErrorMessage()."n";
print getStatisticName."value for bigram is ".$ll_value."n";
The methods in this module retrieve observed trigram frequency counts and marginal totals, and also compute expected values. They also provide support for error checking of the output produced by count.pl. These methods are used in all the trigram (3d) measure modules provided in NSP. If you are writing your own 3d measure, you can use these methods as well.