File Coverage

blib/lib/Lingua/StopWords/EN.pm
Criterion Covered Total %
statement 23 23 100.0
branch 2 2 100.0
condition 2 3 66.6
subroutine 7 7 100.0
pod 0 1 0.0
total 34 36 94.4


line stmt bran cond sub pod time code
1             package Lingua::StopWords::EN;
2              
3 2     2   1203 use strict;
  2         6  
  2         68  
4 2     2   10 use warnings;
  2         5  
  2         62  
5              
6 2     2   687 use utf8;
  2         18  
  2         17  
7              
8 2     2   670 use Encode qw(encode);
  2         11466  
  2         175  
9              
10 2     2   16 use Exporter;
  2         4  
  2         748  
11             our @ISA = qw(Exporter);
12              
13             our %EXPORT_TAGS = ( 'all' => [ qw( getStopWords ) ] );
14             our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
15             our $VERSION = 0.10;
16              
17             sub getStopWords {
18 3 100 66 3 0 17 if ( @_ and $_[0] eq 'UTF-8' ) {
19 1         3 my %stoplist = map { ( $_, 1 ) } _stopwords();
  174         321  
20 1         17 return \%stoplist;
21             }
22             else {
23 2         9 my %stoplist = map { ( encode("iso-8859-1", $_), 1 ) } _stopwords();
  348         9184  
24 2         367 return \%stoplist;
25             }
26             }
27              
28             sub _stopwords {
29 3     3   70 return qw(
30             i me my myself we our ours ourselves you your yours yourself
31             yourselves he him his himself she her hers herself it its
32             itself they them their theirs themselves what which who whom
33             this that these those am is are was were be been being have has
34             had having do does did doing would should could ought i'm
35             you're he's she's it's we're they're i've you've we've they've
36             i'd you'd he'd she'd we'd they'd i'll you'll he'll she'll we'll
37             they'll isn't aren't wasn't weren't hasn't haven't hadn't
38             doesn't don't didn't won't wouldn't shan't shouldn't can't
39             cannot couldn't mustn't let's that's who's what's here's
40             there's when's where's why's how's a an the and but if or
41             because as until while of at by for with about against between
42             into through during before after above below to from up down in
43             out on off over under again further then once here there when
44             where why how all any both each few more most other some such
45             no nor not only own same so than too very
46             );
47             }
48              
49             1;