function file_exists(file) local f = io.open(file, "rb") if f then f:close() end return f ~= nil end function lines_from(file) if not file_exists(file) then return {} end local lines = {} for line in io.lines(file) do lines[#lines + 1] = line end return lines end function table_contains_element(table, element) for key, value in pairs(table) do if value == element then return true end end return false end function table_find_word(table, word) for key,value in ipairs(table) do for w in string.gmatch(value,"%a+") do if w == word then return true end end end return false end