added parameters to limit search to heonian or translation
This commit is contained in:
@@ -2,13 +2,34 @@ 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
|
||||
local all = true
|
||||
for _, v in pairs(arg) do
|
||||
if v == "-r" or v == "--raw" then
|
||||
all = false
|
||||
word = string.gsub(words[i][1],"%p","")
|
||||
if string.find(word, query) then
|
||||
exit = false
|
||||
break
|
||||
end
|
||||
end
|
||||
if v == "-e" or v == "--english" then
|
||||
all = false
|
||||
word = string.gsub(words[i][2],"%p","")
|
||||
if string.find(word, query) then
|
||||
exit = false
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if all == true then
|
||||
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
|
||||
end
|
||||
if not exit then
|
||||
local word = {i,words[i]}
|
||||
table.insert(results_table,word)
|
||||
|
||||
Reference in New Issue
Block a user