I'm trying to get an array of hashes (called hashes) which I will proceed to fill with booleans based on whether or not a word in a line of input is in some arrays. To put this into perspective, I'm taking a line of input, and scanning it to see if the words in that input are inside a series of arrays I have set up.
11: for i in words
12: if nouns.include?(words[i])
13: hashes[i][:nouns] = true
14: end
15:
16: if adjectives.include?(words[i])
17: hashes[i][:adjectives] = true
18: end
19: end
This errors on line 12, saying Analyzer.rb:12 in `[]': can't convert Array into Integer (TypeError)
I get the feeling I've just made a silly formatting error somewhere, but I can't see it. Any Suggestions? Thank you in advance.
words?