We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Stop Words

Now that we have a list of tokens, we need to decide which ones are actually useful for search. Not all tokens are created equal...

Examples of High-Value Tokens

  • bear
  • panda
  • london
  • protector

Examples of Low-Value Tokens

  • a
  • the
  • is
  • of
  • in

These are examples of stop words: common words that usually don't add much meaning. In short, we're going to remove them.

Why Remove Stop Words?

Our goal is to match words from the user's input to words in our dataset. If we don't remove stop words, we can get some pretty misleading results. Here's an example:

User query: "the bear"

Results:

  • "Jungle Bear": matches "bear".
  • "The Terminator": matches "the".

Oof! Both movies match, but "Jungle Bear" is clearly more relevant. "The Terminator" matches only on a low-value stop word.

Assignment

Remove stop word tokens from both the user query and the title tokens.

    • For example, aren't should become arent before you compare tokens against it!

Run and submit the CLI tests.

Stopword List

a
about
above
after
again
against
ain
all
am
an
and
any
are
aren
aren't
as
at
be
because
been
before
being
below
between
both
but
by
can
couldn
couldn't
d
did
didn
didn't
do
does
doesn
doesn't
doing
don
don't
down
during
each
few
for
from
further
had
hadn
hadn't
has
hasn
hasn't
have
haven
haven't
having
he
he'd
he'll
he's
her
here
hers
herself
him
himself
his
how
i
i'd
i'll
i'm
i've
if
in
into
is
isn
isn't
it
it'd
it'll
it's
its
itself
just
ll
m
ma
me
mightn
mightn't
more
most
mustn
mustn't
my
myself
needn
needn't
no
nor
not
now
o
of
off
on
once
only
or
other
our
ours
ourselves
out
over
own
re
s
same
shan
shan't
she
she'd
she'll
she's
should
should've
shouldn
shouldn't
so
some
such
t
than
that
that'll
the
their
theirs
them
themselves
then
there
these
they
they'd
they'll
they're
they've
this
those
through
to
too
under
until
up
ve
very
was
wasn
wasn't
we
we'd
we'll
we're
we've
were
weren
weren't
what
when
where
which
while
who
whom
why
will
with
won
won't
wouldn
wouldn't
y
you
you'd
you'll
you're
you've
your
yours
yourself
yourselves