Verbnet/Ambiguity.pm untested

filter: Statementstmt 0.0% 0 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 15 CC 1 SCAR 6.9
CC
1
Cov
0%
score
2.0
hash
2.0
BEGIN
2.0
CRAP 2.0
1 package Lingua::Verbnet::Ambiguity;
2  
3 use strict;
4 use warnings;
5  
6 # no explicit ctor, it's constructed via Lingua::Verbnet->ambiguity
7  
8 sub score ($$) { $_[0]->{$_[1]}; }
9 sub hash ($) { %{$_[0]}; }
10  
11 1;
12  
13 =head1 NAME
14  
15 Lingua::Verbnet::Ambiguity -- query ambiguity stats as collected by Lingua::Verbnet
16  
17 =head1 SYNOPSIS
18  
19 use Lingua::Verbnet;
20 my @verbnet_xml_files = ... ;
21 my $verbnet = Lingua::Verbnet->new(@verbnet_xml_files);
22 $verbnet->ambiguity->score('cut'); # get the ambiguity score of the verb 'cut'
23 my %stats = $verbnet->ambiguity->hash; # get the full ambiguity scores hash (verb => score)
24  
25 =head1 DESCRIPTION
26  
27 An object to query ambiguity stats as collected by Lingua::Verbnet.
28  
29 Accessed through Lingua::Verbnet.
30  
31 =head1 METHODS
32  
33 =over
34  
35 =item score
36  
37 Given a verb which is a member of a given vnclass,
38 return its ambiguity score as determined
39 by the number of frames within the vnclass.
40  
41 If a verb is not listed in the verbnet database
42 that had been fed to Lingua::Verbnet, then 0 is returned.
43  
44 =item hash
45  
46 Return the object contents in a hash format, in the form of
47 (
48 verb1 => score1,
49 verb2 => score2,
50 ...
51 )
52  
53 =back
54  
55 =head1 SEE ALSO
56  
57 L<Lingua::Verbnet>
58  
59 =head1 AUTHOR
60  
61 Vassilii Khachaturov <F<vassilii@tarunz.org>>
62  
63 =head1 LICENSE
64  
65 This program is free software; you can redistribute it and/or
66 modify it under the same terms as Perl itself.
67  
68 See F<http://www.perl.com/perl/misc/Artistic.html>