Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.31 KB | None | 0 0
  1. testSentence = "This is a TEST sentence."
  2. lexicon = {}
  3.  
  4. for line in io.lines("lexicon.txt") do
  5.     key = string.match(line, ".- ")
  6.     if key ~= nil then lexicon[key] = string.match(line, " (.*)") end
  7. end
  8.  
  9. words = {}
  10. for word in testSentence:gmatch("%S+") do
  11.     table.insert(words, word)
  12. end
  13.  
  14. print(lexicon["value"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement