Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Lexicon
- attr_accessor :token, :word
- # the token are: direction, verb, stop, noun, number
- # the words are the words from those tokens
- def Pair(token, word)
- @token = token
- @word = word
- end
- def scan(stuff)
- @words = stuff.split()
- if @words.include? @word
- return token
- else
- puts "The word %s was not found" % @token
- end
- end
- def add_words(words)
- @words.update(words)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement