Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- testSentence = "This is a TEST sentence."
- lexicon = {}
- for line in io.lines("lexicon.txt") do
- key = string.match(line, ".- ")
- if key ~= nil then lexicon[key] = string.match(line, " (.*)") end
- end
- words = {}
- for word in testSentence:gmatch("%S+") do
- table.insert(words, word)
- end
- print(lexicon["value"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement