Write a program or function that given a string (or your language's equivalent), determine if the string is a word, or not, and output a truthy or falsy value.
(This is not a duplicate of Is this even a word? The incorrect words are generated in a very different way that I believe makes this a completely different challenge)
The words will all be lowercase, between 5 and 10 characters, and have no apostrophes.
The correct words are a randomly selected subset of the SCOWL English words list (size 50).
The incorrect words are generated via two methods: swapping and substitution.
The "swapping" words are generated using a modified Fisher-Yates shuffle on the letters of randomly selected (real) words. Instead of swapping the letters every time, a letter may or may not be swapped (the probability varies, so some words will be more realistic than others). If the new word matches an existing word, the result is discarded and it generates another word.
The "substitution" words are generated using a similar method, but instead of swapping the letter with another letter, each letter has a chance of being replaced with another random letter.
Each method is used to generate 50% of the fake words.
Your function must be less than 150 bytes. The scoring is determined as follows:
percentage of answers correct + ((150 - length of program) / 10)
Since this deals with a large number of test cases (each wordlist is 1000 words), an automated testing program is fine. The automated tester does not count towards the length of the program; however, it should be posted so that others are able to test it.
- No loopholes.
- No spelling/dictionary related built-ins.
List of words: http://pastebin.com/Leb6rUvt
List of not words (updated): http://pastebin.com/rEyWdV7S
Other resources (SCOWL wordlist and the code used to generate the random words): https://www.dropbox.com/sh/46k13ekm0zvm19z/AAAFL25Z8ogLvXWTDmRwVdiGa?dl=0
supermax. (Side note: I was delighted to find out that
supermaxis an actual word) \$\endgroup\$