File Coverage

blib/lib/WWW/WolframAlpha/Spellcheck.pm
Criterion Covered Total %
statement 9 24 37.5
branch 0 8 0.0
condition 0 6 0.0
subroutine 3 7 42.8
pod 0 4 0.0
total 12 49 24.4


line stmt bran cond sub pod time code
1             package WWW::WolframAlpha::Spellcheck;
2              
3 1     1   27 use 5.008008;
  1         4  
  1         43  
4 1     1   6 use strict;
  1         1  
  1         25  
5 1     1   4 use warnings;
  1         2  
  1         329  
6              
7             require Exporter;
8              
9             our @ISA = qw(Exporter);
10              
11             # Items to export into callers namespace by default. Note: do not export
12             # names by default without a very good reason. Use EXPORT_OK instead.
13             # Do not simply export all your public functions/methods/constants.
14              
15             # This allows declaration use WWW::WolframAlpha ':all';
16             # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
17             # will save memory.
18             our %EXPORT_TAGS = ( 'all' => [ qw(
19             ) ] );
20              
21             our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
22              
23             our @EXPORT = qw(
24             );
25              
26             our $VERSION = '1.0';
27              
28             sub new {
29 0     0 0   my $class = shift;
30 0           my $xmlo = shift;
31              
32 0           my $self = {};
33              
34 0           my ($word,$text,$suggestion);
35              
36 0 0         if ($xmlo) {
37 0   0       $word = $xmlo->{'word'} || undef;
38 0   0       $text = $xmlo->{'text'} || undef;
39 0   0       $suggestion = $xmlo->{'suggestion'} || undef;
40              
41 0 0         $self->{'word'} = $word if defined $word;
42 0 0         $self->{'text'} = $text if defined $text;
43 0 0         $self->{'suggestion'} = $suggestion if defined $suggestion;
44             }
45              
46 0           return(bless($self, $class));
47             }
48              
49 0     0 0   sub text {shift->{'text'};}
50 0     0 0   sub word {shift->{'word'};}
51 0     0 0   sub suggestion {shift->{'suggestion'};}
52              
53              
54             # Preloaded methods go here.
55              
56             1;
57              
58              
59             =pod
60              
61             =head1 NAME
62              
63             WWW::WolframAlpha::Spellcheck
64              
65             =head1 VERSION
66              
67             version 1.10
68              
69             =head1 SYNOPSIS
70              
71             foreach my $spellcheck (@{$query->warnings->spellcheck}) {
72             print " Spellcheck word: ", $spellcheck->word, "\n";
73             print " suggestion: ", $spellcheck->suggestion, "\n" if $spellcheck->suggestion;
74             print " text: ", $spellcheck->text, "\n" if $spellcheck->text;
75             }
76              
77             =head1 DESCRIPTION
78              
79             =head2 ATTRIBUTES
80              
81             $spellcheck->word
82              
83             $spellcheck->suggestion
84              
85             $spellcheck->text
86              
87             =head2 EXPORT
88              
89             None by default.
90              
91             =head1 NAME
92              
93             WWW::WolframAlpha::Spellcheck - Perl objects returned via $query->warnings->spellcheck
94              
95             =head1 SEE ALSO
96              
97             L
98              
99             =head1 AUTHOR
100              
101             Gabriel Weinberg, Eyegg@alum.mit.eduE
102              
103             =head1 COPYRIGHT AND LICENSE
104              
105             Copyright (C) 2009 by Gabriel Weinberg
106              
107             This library is free software; you can redistribute it and/or modify
108             it under the same terms as Perl itself, either Perl version 5.8.8 or,
109             at your option, any later version of Perl 5 you may have available.
110              
111             =head1 AUTHOR
112              
113             Gabriel Weinberg
114              
115             =head1 COPYRIGHT AND LICENSE
116              
117             This software is copyright (c) 2009 by Gabriel Weinberg.
118              
119             This is free software; you can redistribute it and/or modify it under
120             the same terms as the Perl 5 programming language system itself.
121              
122             =cut
123              
124              
125             __END__