conlang-heonian/search_list.lua
2022-03-22 21:11:14 +01:00

23 lines
502 B
Lua

return function(query)
results_table = {}
for i=1, #words do
local exit = true
for j=1, #words[i]-1 do
word = string.gsub(words[i][j],"%p","")
if string.find(word, query) then
exit = false
break
end
end
if not exit then
local word = {i,words[i]}
table.insert(results_table,word)
end
end
if #results_table ~= 0 then
results_table = adjustTableSizes(results_table)
printOutputTable(results_table)
else
print("no words found for <" .. query .. ">")
end
end