File Coverage

blib/lib/WebService/DetectLanguage/Result.pm
Criterion Covered Total %
statement 5 5 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 7 7 100.0


line stmt bran cond sub pod time code
1             package WebService::DetectLanguage::Result;
2             $WebService::DetectLanguage::Result::VERSION = '0.04';
3 1     1   15 use 5.006;
  1         3  
4 1     1   4 use Moo;
  1         2  
  1         4  
5              
6             has language => ( is => 'ro' );
7             has is_reliable => ( is => 'ro' );
8             has confidence => ( is => 'ro' );
9              
10             1;
11              
12             =head1 NAME
13              
14             WebService::DetectLanguage::Result - a language detection result from detectlanguage.com
15              
16             =head1 SYNOPSIS
17              
18             my ($result) = $api->detect($text);
19             printf "language = %s (%s)\n", $result->language->name, $result->language->code;
20             printf "reliable = %s\n", $result->is_reliable ? 'Yes' : 'No';
21             printf "confidence = %f\n", $result->confidence;
22              
23             =head1 DESCRIPTION
24              
25             This module is a class for data objects returned
26             by the C or C methods
27             of L.
28              
29             See the documentation of that module for more details.
30              
31             =head1 ATTRIBUTES
32              
33             =head2 language
34              
35             An instance of L,
36             which provides the C and C for the identified language.
37              
38             =head2 confidence
39              
40             A confidence level for the result,
41             which is a bit like a percentage,
42             but can be higher than 100.
43              
44             =head2 is_reliable
45              
46             A boolean, which says whether this is a good guess.
47              
48             =head1 SEE ALSO
49              
50             L the main module for talking
51             to the language detection API at detectlanguage.com.
52              
53             =head1 AUTHOR
54              
55             Neil Bowers Eneilb@cpan.orgE
56              
57             =head1 LICENSE AND COPYRIGHT
58              
59             This software is copyright (c) 2019 by Neil Bowers .
60              
61             This is free software; you can redistribute it and/or modify it under
62             the same terms as the Perl 5 programming language system itself.
63