RePrec
view release on metacpan or search on metacpan
lib/RePrec.pm view on Meta::CPAN
foreach (@$distribution) {
croak 'distribution: wrong format' unless ref $_ eq 'ARRAY' and @$_ == 2;
$rels += $_->[0];
$nrels += $_->[1];
}
$self->{rels} = $rels;
$self->{nrels} = $nrels;
$self->{numdocs} = $rels + $nrels;
bless $self => $class;
$self->_sortrfdata($distribution);
$self;
}
=pod #---------------------------------------------------------------#
=item $visual = $rp->visual
lib/RePrec/Average.pm view on Meta::CPAN
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
$self->{rp} = [ @_ ];
$self->{divisor} = scalar @_;
bless $self => $class;
}
=cut #---------------------------------------------------------------#
=item ($graph, $average) = $rp->calculate([$points])
calculates precision values for $points (see respective method in
RePrec(3)). As a result you get a list of (recall, average precision)
pairs (array of array references with two elements each) and the
averaged average precision (over all recall points computed).
lib/RePrec/Collection.pm view on Meta::CPAN
## public ############################################################
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my %params = @_;
my $self = {};
bless $self => $class;
$self->_init(%params);
return $self;
}
sub get_numdocs {
my $self = shift;
lib/RePrec/Searchresult.pm view on Meta::CPAN
## public ############################################################
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
my($qid, $results, @parms) = @_;
bless $self => $class;
if (defined $results) {
if (ref $results eq 'ARRAY') {
foreach (@{$results}) {
croak "Wrong type of search result element"
unless ref $_ eq 'ARRAY' and @$_ == 2;
}
$self->{results} = $results;
} elsif (ref $results) {
croak "Wrong reference type for results parameter";
( run in 0.358 second using v1.01-cache-2.11-cpan-65fba6d93b7 )