Skip to content

Commit

Permalink
Add 'require set' and use explicit namespace for Set class
Browse files Browse the repository at this point in the history
- Add 'require set' at the beginning of the file
- Update CORPUS_SKIP_WORDS to use ::Set instead of Set
  • Loading branch information
cardmagic committed Jul 31, 2024
1 parent 87d1589 commit 5bea84c
Showing 1 changed file with 84 additions and 82 deletions.
166 changes: 84 additions & 82 deletions lib/classifier/extensions/word_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Copyright:: Copyright (c) 2005 Lucas Carlson
# License:: LGPL

require 'set'

# These are extensions to the String class to provide convenience
# methods for the Classifier package.
class String
Expand Down Expand Up @@ -45,86 +47,86 @@ def word_hash_for_symbols(words)
d
end

CORPUS_SKIP_WORDS = Set.new(%w[
a
again
all
along
are
also
an
and
as
at
but
by
came
can
cant
couldnt
did
didn
didnt
do
doesnt
dont
ever
first
from
have
her
here
him
how
i
if
in
into
is
isnt
it
itll
just
last
least
like
most
my
new
no
not
now
of
on
or
should
sinc
so
some
th
than
this
that
the
their
then
those
to
told
too
true
try
until
url
us
were
when
whether
while
with
within
yes
you
youll
])
CORPUS_SKIP_WORDS = ::Set.new(%w[
a
again
all
along
are
also
an
and
as
at
but
by
came
can
cant
couldnt
did
didn
didnt
do
doesnt
dont
ever
first
from
have
her
here
him
how
i
if
in
into
is
isnt
it
itll
just
last
least
like
most
my
new
no
not
now
of
on
or
should
sinc
so
some
th
than
this
that
the
their
then
those
to
told
too
true
try
until
url
us
were
when
whether
while
with
within
yes
you
youll
])
end

0 comments on commit 5bea84c

Please sign in to comment.