Advertisement
Guest User

Untitled

a guest
Dec 29th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Julia 0.49 KB | None | 0 0
  1. # dictionary of valid words
  2. dict = Set{String}()
  3.  
  4. # read each word into the dictionary
  5. open("/usr/share/dict/american-english") do file
  6.         for line in eachline(file)
  7.                 push!(dict, line)
  8.         end
  9. end
  10.  
  11. # read from stdin, split on space, and compare to dict
  12. for line in eachline(stdin)
  13.         words = split(line, ' ')
  14.         for word in words  
  15.                 if in(word, dict) == false
  16.                         println(word)
  17.                 end
  18.         end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement