diff --git a/lexicon b/lexicon index ce7acc1..4d645a2 100755 --- a/lexicon +++ b/lexicon @@ -42,10 +42,12 @@ or arg[1] == "howdo" then - transcripts the word to heonian script Parameters: --h / --help (shows what does the command do) -a / --all (shows more info on the word, if any) --v / --verbose (shows the transcription process) -c / --copy (copies transcription to keyboard) +-e / --english (limits the search to the translated words) +-h / --help (shows what does the command do) +-r / --raw (limits the search to the heonian words) +-v / --verbose (shows the transcription process) ]]) return end @@ -77,6 +79,8 @@ or arg[1] == "search" then Parameters: -h / --help (shows what does the command do) -a / --all (shows more info on the word, if any) +-e / --english (limits the search to the translated words) +-r / --raw (limits the search to the heonian words) ]]) else if arg[2] then searchList(arg[2]) diff --git a/output_word.lua b/output_word.lua index a787c66..cf18724 100644 --- a/output_word.lua +++ b/output_word.lua @@ -1,5 +1,6 @@ return function(tbl) local show_all = false + for _, v in pairs(arg) do if v == "-a" or v == "--all" then show_all = true end end diff --git a/search_list.lua b/search_list.lua index 5e5b0c1..ced6cf7 100644 --- a/search_list.lua +++ b/search_list.lua @@ -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)