Skip to content

Commit 5bea84c

Browse files
committed
Add 'require set' and use explicit namespace for Set class
- Add 'require set' at the beginning of the file - Update CORPUS_SKIP_WORDS to use ::Set instead of Set
1 parent 87d1589 commit 5bea84c

File tree

1 file changed

+84
-82
lines changed

1 file changed

+84
-82
lines changed

lib/classifier/extensions/word_hash.rb

Lines changed: 84 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Copyright:: Copyright (c) 2005 Lucas Carlson
33
# License:: LGPL
44

5+
require 'set'
6+
57
# These are extensions to the String class to provide convenience
68
# methods for the Classifier package.
79
class String
@@ -45,86 +47,86 @@ def word_hash_for_symbols(words)
4547
d
4648
end
4749

48-
CORPUS_SKIP_WORDS = Set.new(%w[
49-
a
50-
again
51-
all
52-
along
53-
are
54-
also
55-
an
56-
and
57-
as
58-
at
59-
but
60-
by
61-
came
62-
can
63-
cant
64-
couldnt
65-
did
66-
didn
67-
didnt
68-
do
69-
doesnt
70-
dont
71-
ever
72-
first
73-
from
74-
have
75-
her
76-
here
77-
him
78-
how
79-
i
80-
if
81-
in
82-
into
83-
is
84-
isnt
85-
it
86-
itll
87-
just
88-
last
89-
least
90-
like
91-
most
92-
my
93-
new
94-
no
95-
not
96-
now
97-
of
98-
on
99-
or
100-
should
101-
sinc
102-
so
103-
some
104-
th
105-
than
106-
this
107-
that
108-
the
109-
their
110-
then
111-
those
112-
to
113-
told
114-
too
115-
true
116-
try
117-
until
118-
url
119-
us
120-
were
121-
when
122-
whether
123-
while
124-
with
125-
within
126-
yes
127-
you
128-
youll
129-
])
50+
CORPUS_SKIP_WORDS = ::Set.new(%w[
51+
a
52+
again
53+
all
54+
along
55+
are
56+
also
57+
an
58+
and
59+
as
60+
at
61+
but
62+
by
63+
came
64+
can
65+
cant
66+
couldnt
67+
did
68+
didn
69+
didnt
70+
do
71+
doesnt
72+
dont
73+
ever
74+
first
75+
from
76+
have
77+
her
78+
here
79+
him
80+
how
81+
i
82+
if
83+
in
84+
into
85+
is
86+
isnt
87+
it
88+
itll
89+
just
90+
last
91+
least
92+
like
93+
most
94+
my
95+
new
96+
no
97+
not
98+
now
99+
of
100+
on
101+
or
102+
should
103+
sinc
104+
so
105+
some
106+
th
107+
than
108+
this
109+
that
110+
the
111+
their
112+
then
113+
those
114+
to
115+
told
116+
too
117+
true
118+
try
119+
until
120+
url
121+
us
122+
were
123+
when
124+
whether
125+
while
126+
with
127+
within
128+
yes
129+
you
130+
youll
131+
])
130132
end

0 commit comments

Comments
 (0)