Here's an idea: convert the input into lowercase before making any comparisons:
tokens = test.lower().split()
And make sure that all the elements in words
are in lowercase, too:
words = { e.lower() for e in words }
By doing the above, we're comparing only lowercase characters throughout the program, so capitalization should not be a problem.