Advertisement
Guest User

Untitled

a guest
Feb 17th, 2012
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. class Lexicon
  2.  
  3. attr_accessor :token, :word
  4. # the token are: direction, verb, stop, noun, number
  5. # the words are the words from those tokens
  6. def Pair(token, word)
  7. @token = token
  8. @word = word
  9. end
  10.  
  11.  
  12. def scan(stuff)
  13. @words = stuff.split()
  14. if @words.include? @word
  15. return token
  16. else
  17. puts "The word %s was not found" % @token
  18. end
  19. end
  20.  
  21. def add_words(words)
  22. @words.update(words)
  23. end
  24.  
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement