File Coverage

blib/lib/Lingua/StopWords.pm
Criterion Covered Total %
statement 18 18 100.0
branch 5 6 83.3
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 28 29 96.5


line stmt bran cond sub pod time code
1             package Lingua::StopWords;
2 2     2   157289 use strict;
  2         15  
  2         57  
3 2     2   11 use warnings;
  2         2  
  2         337  
4              
5             require Exporter;
6             our @ISA = qw(Exporter);
7             our %EXPORT_TAGS = ( 'all' => [ qw( getStopWords ) ] );
8             our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
9             our $VERSION = 0.10;
10              
11             sub getStopWords {
12 33     33 1 22278 my ( $language, $encoding ) = @_;
13              
14 33 50       98 return undef unless $language;
15              
16 33         74 $language = uc($language);
17 33         59 eval { require "Lingua/StopWords/$language.pm"; };
  33         7860  
18 33 100       137 return undef if $@;
19              
20 32 100       102 my @args = $encoding ? ($encoding) : ();
21 2     2   15 no strict 'refs';
  2         4  
  2         179  
22 32         47 return &{ "Lingua::StopWords::$language\::getStopWords" }(@args);
  32         193  
23             }
24              
25             1;
26              
27             __END__