Is it simple or is it hard?
R, 106 bytes
Is not sure if is understand challenge because is has hard time reading.
function(s){u=toupper;all(strsplit(gsub("[^A-Z -']","",u(s)),"[ -]")[[1]]%in%u(scan("most used.txt","")))}
This creates an unnamed part of a computer thing that accepts a string and returns something like a true or like a not true.
Ungolfed + explanation:
partOfAComputerThing <- function(s) {
# Remove everything but letters, spaces, dashes, and single quotes
s <- gsub("[^A-Z -']", "", toupper(s))
# Split s into a vector on spaces/dashes
v <- strsplit(s, "[ -]")[[1]]
# Read the file of words (assumed to reside in the current directory)
m <- scan("most used.txt", "")
# Determine if all words in the input are in the file
all(v %in% toupper(m))
}
Thanks to Dennis for inspiration thing.
CJam, 41 bytes
q"file:///most used.txt"g]{el_euS--S%}/-!
This makes the rather unclean assumption that most used.txt
is in the root directory, since CJam cannot handle relative paths.
Alternatively, we have the following web-based solutions (78 and 29 bytes):
q"https://docs.google.com/uc?id=0B2sM8IORrbL3RVpJWTZNUy1rOFU"g]{el_euS--S%}/-!
q"j.mp/-o_O"g]{el_euS--S%}/-!
The "proper" way of doing this in CJam would be reading both inputs from STDIN (input on the first line, dictionary on the second), which is possible in 18 bytes:
qN%{el_euS--S%}/-!
You can try the last version in the CJam interpreter. (permalink tested in Chrome)
Examples
$ cjam <(echo 'q"file:///most used.txt"g]{el_euS--S%}/-!') <<< 'ten hundred'; echo
1
$ cjam <(echo 'q"file:///most used.txt"g]{el_euS--S%}/-!') <<< 'thousand'; echo
0
Python 3, 148 bytes
import re
print(all(i in open("most used.txt").read().lower().split(' ')for i in re.sub("[^a-z ']+","",input().replace("-"," ").lower()).split(" ")))
Outputs True
and False
Examples
Input: Don't
Output: True
Input: The poison air he's breathing has a dirty smell of dying
Output: False
Input: Who let the dogs out?
Output: False