File Coverage

blib/lib/Lingua/EN/StopWordList.pm
Criterion Covered Total %
statement 9 13 69.2
branch n/a
condition n/a
subroutine 3 5 60.0
pod 2 2 100.0
total 14 20 70.0


line stmt bran cond sub pod time code
1             package Lingua::EN::StopWordList;
2              
3 1     1   24742 use 5.008;
  1         4  
  1         41  
4 1     1   6 use strict;
  1         2  
  1         36  
5 1     1   6 use warnings;
  1         7  
  1         676  
6              
7             our $VERSION = '1.00';
8              
9             # -----------------------------------------------
10              
11             sub new
12             {
13 0     0 1   my($class) = @_;
14              
15 0           return bless {}, $class;
16              
17             } # End of new.
18              
19             # -----------------------------------------------
20              
21             sub words
22             {
23 0     0 1   my($self) = @_;
24              
25 0           return [qw/
26             a
27             able
28             about
29             above
30             abroad
31             according
32             accordingly
33             across
34             actually
35             adj
36             after
37             afterwards
38             again
39             against
40             ago
41             ahead
42             ain't
43             all
44             allow
45             allows
46             almost
47             alone
48             along
49             alongside
50             already
51             also
52             although
53             always
54             am
55             amid
56             amidst
57             among
58             amongst
59             an
60             and
61             another
62             any
63             anybody
64             anyhow
65             anyone
66             anything
67             anyway
68             anyways
69             anywhere
70             apart
71             appear
72             appreciate
73             appropriate
74             are
75             aren't
76             around
77             a's
78             as
79             aside
80             ask
81             asking
82             associated
83             at
84             available
85             away
86             awfully
87             b
88             back
89             backward
90             backwards
91             be
92             became
93             because
94             become
95             becomes
96             becoming
97             been
98             before
99             beforehand
100             begin
101             behind
102             being
103             believe
104             below
105             beside
106             besides
107             best
108             better
109             between
110             beyond
111             both
112             brief
113             but
114             by
115             c
116             came
117             can
118             cannot
119             can't
120             cant
121             caption
122             cause
123             causes
124             certain
125             certainly
126             changes
127             clearly
128             c'mon
129             co.
130             co
131             com
132             come
133             comes
134             concerning
135             consequently
136             consider
137             considering
138             contain
139             containing
140             contains
141             corresponding
142             could
143             couldn't
144             course
145             c's
146             currently
147             d
148             dare
149             daren't
150             definitely
151             described
152             despite
153             did
154             didn't
155             different
156             directly
157             do
158             does
159             doesn't
160             doing
161             done
162             don't
163             down
164             downwards
165             during
166             e
167             each
168             edu
169             eg
170             eight
171             eighty
172             either
173             else
174             elsewhere
175             end
176             ending
177             enough
178             entirely
179             especially
180             et
181             etc
182             even
183             ever
184             evermore
185             every
186             everybody
187             everyone
188             everything
189             everywhere
190             ex
191             exactly
192             example
193             except
194             f
195             fairly
196             far
197             farther
198             few
199             fewer
200             fifth
201             first
202             five
203             followed
204             following
205             follows
206             for
207             forever
208             former
209             formerly
210             forth
211             forward
212             found
213             four
214             from
215             further
216             furthermore
217             g
218             get
219             gets
220             getting
221             given
222             gives
223             go
224             goes
225             going
226             gone
227             got
228             gotten
229             greetings
230             h
231             had
232             hadn't
233             half
234             happens
235             hardly
236             has
237             hasn't
238             have
239             haven't
240             having
241             he
242             he'd
243             he'll
244             hello
245             help
246             hence
247             her
248             here
249             hereafter
250             hereby
251             herein
252             here's
253             hereupon
254             hers
255             herself
256             he's
257             hi
258             him
259             himself
260             his
261             hither
262             hopefully
263             how
264             howbeit
265             however
266             hundred
267             i
268             i'd
269             ie
270             if
271             ignored
272             i'll
273             i'm
274             immediate
275             in
276             inasmuch
277             inc.
278             inc
279             indeed
280             indicate
281             indicated
282             indicates
283             inner
284             inside
285             insofar
286             instead
287             into
288             inward
289             is
290             isn't
291             it
292             it'd
293             it'll
294             it's
295             its
296             itself
297             i've
298             j
299             just
300             k
301             keep
302             keeps
303             kept
304             know
305             known
306             knows
307             l
308             last
309             lately
310             later
311             latter
312             latterly
313             least
314             less
315             lest
316             let
317             let's
318             like
319             liked
320             likely
321             likewise
322             little
323             look
324             looking
325             looks
326             low
327             lower
328             ltd
329             m
330             made
331             mainly
332             make
333             makes
334             many
335             may
336             maybe
337             mayn't
338             me
339             mean
340             meantime
341             meanwhile
342             merely
343             might
344             mightn't
345             mine
346             minus
347             miss
348             more
349             moreover
350             most
351             mostly
352             mr
353             mrs
354             much
355             must
356             mustn't
357             my
358             myself
359             n
360             name
361             namely
362             nd
363             near
364             nearly
365             necessary
366             need
367             needn't
368             needs
369             neither
370             never
371             neverf
372             neverless
373             nevertheless
374             new
375             next
376             nine
377             ninety
378             no
379             nobody
380             non
381             none
382             nonetheless
383             no-one
384             noone
385             nor
386             normally
387             not
388             nothing
389             notwithstanding
390             novel
391             now
392             nowhere
393             o
394             obviously
395             of
396             off
397             often
398             oh
399             ok
400             okay
401             old
402             on
403             once
404             one
405             one's
406             ones
407             only
408             onto
409             opposite
410             or
411             other
412             others
413             otherwise
414             ought
415             oughtn't
416             our
417             ours
418             ourselves
419             out
420             outside
421             over
422             overall
423             own
424             p
425             particular
426             particularly
427             past
428             per
429             perhaps
430             placed
431             please
432             plus
433             possible
434             presumably
435             probably
436             provided
437             provides
438             q
439             que
440             quite
441             qv
442             r
443             rather
444             rd
445             re
446             really
447             reasonably
448             recent
449             recently
450             regarding
451             regardless
452             regards
453             relatively
454             respectively
455             right
456             round
457             s
458             said
459             same
460             saw
461             say
462             saying
463             says
464             second
465             secondly
466             see
467             seeing
468             seem
469             seemed
470             seeming
471             seems
472             seen
473             self
474             selves
475             sensible
476             sent
477             serious
478             seriously
479             seven
480             several
481             shall
482             shan't
483             she
484             she'd
485             she'll
486             she's
487             should
488             shouldn't
489             since
490             six
491             so
492             some
493             somebody
494             someday
495             somehow
496             someone
497             something
498             sometime
499             sometimes
500             somewhat
501             somewhere
502             soon
503             sorry
504             specified
505             specify
506             specifying
507             still
508             sub
509             such
510             sup
511             sure
512             t
513             take
514             taken
515             taking
516             tell
517             tends
518             th
519             than
520             thank
521             thanks
522             thanx
523             that
524             that'll
525             that's
526             thats
527             that've
528             the
529             their
530             theirs
531             them
532             themselves
533             then
534             thence
535             there
536             thereafter
537             thereby
538             there'd
539             therefore
540             therein
541             there'll
542             there're
543             there's
544             theres
545             thereupon
546             there've
547             these
548             they
549             they'd
550             they'll
551             they're
552             they've
553             thing
554             things
555             think
556             third
557             thirty
558             this
559             thorough
560             thoroughly
561             those
562             though
563             three
564             through
565             throughout
566             thru
567             thus
568             till
569             to
570             together
571             too
572             took
573             toward
574             towards
575             tried
576             tries
577             truly
578             try
579             trying
580             t's
581             twice
582             two
583             u
584             un
585             under
586             underneath
587             undoing
588             unfortunately
589             unless
590             unlike
591             unlikely
592             until
593             unto
594             up
595             upon
596             upwards
597             us
598             use
599             used
600             useful
601             uses
602             using
603             usually
604             v
605             value
606             various
607             versus
608             very
609             via
610             viz
611             vs
612             w
613             want
614             wants
615             was
616             wasn't
617             way
618             we
619             we'd
620             welcome
621             we'll
622             well
623             went
624             we're
625             were
626             weren't
627             we've
628             what
629             whatever
630             what'll
631             what's
632             what've
633             when
634             whence
635             whenever
636             where
637             whereafter
638             whereas
639             whereby
640             wherein
641             where's
642             whereupon
643             wherever
644             whether
645             which
646             whichever
647             while
648             whilst
649             whither
650             who
651             who'd
652             whoever
653             whole
654             who'll
655             whom
656             whomever
657             who's
658             whose
659             why
660             will
661             willing
662             wish
663             with
664             within
665             without
666             wonder
667             won't
668             would
669             wouldn't
670             x
671             y
672             yes
673             yet
674             you
675             you'd
676             you'll
677             your
678             you're
679             yours
680             yourself
681             yourselves
682             you've
683             z
684             zero
685             /];
686              
687              
688             } # End of words.
689              
690             # -----------------------------------------------
691              
692             1;
693              
694             =pod
695              
696             =head1 NAME
697              
698             Lingua::EN::StopWordList - A sorted list of English stop words
699              
700             =head1 Synopsis
701              
702             use Lingua::EN::StopWordList;
703              
704             my($ara_ref) = Lingua::EN::StopWordList -> new -> words;
705              
706             Here's a complete program:
707              
708             use strict;
709             use warnings;
710             use Lingua::EN::StopWordList;
711              
712             my($count) = 0;
713              
714             print map{"@{[++$count]}: $_\n"} @{Lingua::EN::StopWordList -> new -> words};
715              
716             =head1 Description
717              
718             C is a pure Perl module.
719              
720             It returns a sorted arrayref of 659 English stop words.
721              
722             =head1 Constructor and initialization
723              
724             new(...) returns an object of type C.
725              
726             This is the class's contructor.
727              
728             Usage: C<< Lingua::EN::StopWordList -> new >>.
729              
730              
731             =head1 Distributions
732              
733             This module is available as a Unix-style distro (*.tgz).
734              
735             Install C as you would for any C module:
736              
737             Run:
738              
739             cpanm Lingua::EN::StopWordList
740              
741             or run:
742              
743             sudo cpan Lingua::EN::StopWordList
744              
745             or unpack the distro, and then run one of:
746              
747             perl Build.PL
748             ./Build
749             ./Build test
750             ./Build install
751              
752             or
753              
754             perl Makefile.PL
755             make (or dmake)
756             make test
757             make install
758              
759             See L for details.
760              
761             See L for
762             help on unpacking and installing.
763              
764             =head1 Methods
765              
766             =head2 new()
767              
768             See L.
769              
770             =head2 words()
771              
772             Returns the sorted arrayref of English stop words.
773              
774             =head1 FAQ
775              
776             =head2 Is there a definitive list of stop words?
777              
778             No, there is no such thing as a definitive list.
779             For an important discussion, e.g. including 'phrase search', see
780             L.
781              
782             =head2 Where does the list come from?
783              
784             I downloaded it from the bottom of this page: L.
785             It contains 659 words.
786              
787             =head2 Are there other lists available?
788              
789             Sure. Try L.
790             This list contains 570 words.
791              
792             Another good place to look is L, but its English list
793             only contains 174 words. Since L (below) also has 174 words in its Englist list,
794             perhaps this is where that module got its words from.
795             Lastly, it has stop word lists for a whole range of languages.
796              
797             Alternately, just Google for references to various lists. Note however these lists are normally very
798             short.
799              
800             =head2 Why another Perl module for stop words?
801              
802             L only has a short list of words (174). And its bug list goes back 3 years.
803              
804             L only has a short list of words (227). Also, this module is part of
805             L, whose documentation is poor. Even the exact basis of how it splits text
806             is not documented. Lastly, its bug list goes back 6 years.
807              
808             I could have offered to take over maintentance of either or both those modules, but there are problems:
809              
810             =over 4
811              
812             =item o L
813              
814             It ships with a set of sub-modules, with names like L, but I'm not in a position
815             to support its other languages if I put my module's English list into it.
816              
817             Nevertheless, the fact that it supports 13 languages is definitely something in favour of this module.
818              
819             =item o L
820              
821             This is part of text processing stuff which I don't want to get involved with. Also, it has a long
822             list of pre-reqs (not listed on MetaCPAN until you view the makefile), which may well suit the purposes
823             of L, but is overkill for just a stop word list.
824              
825             =back
826              
827             Several other Perl modules, written for various purposes, either use one of the above, or have their
828             own very short (as always) lists.
829              
830             =head2 How can I help?
831              
832             If you translate the list of stop words in this module into your favourite language and email it to
833             me, I will include your words in the next release.
834              
835             It all depends on whether you think this new list is somehow 'better' than the lists in pre-existing
836             modules. I cannot make that decision on your behalf.
837              
838             =head1 Support
839              
840             Email the author, or log a bug on RT:
841              
842             L.
843              
844             =head1 Author
845              
846             C was written by Ron Savage Iron@savage.net.auE> in 2012.
847              
848             Home page: L.
849              
850             =head1 Copyright
851              
852             Australian copyright (c) 2012 Ron Savage.
853              
854             All Programs of mine are 'OSI Certified Open Source Software';
855             you can redistribute them and/or modify them under the terms of
856             The Artistic License, a copy of which is available at:
857             http://www.opensource.org/licenses/index.html
858              
859              
860             =cut