require "r2h2_modified" words = dofile("heonian-content/words.lua") function cell_builder(...) arg = {...} for i=1, #arg do apply_html("html/words/definition/cell_start.html") apply(arg[i]) apply_html("html/words/definition/cell_end.html") end end function print_word_stuff(word) apply_html("html/words/definition/start.html") local exit = false for _, v in pairs(words) do if strip_symbols(v[1]) == strip_spaces(word) then cell_builder(mod_convertToHeonian(word),v[1],v[3],v[2]) exit = true end end if not exit then cell_builder(mod_convertToHeonian(word),word, "???","???") end apply_html("html/words/definition/end.html") end function add_word(str) local add = true for _, v in pairs(word_list) do if v == str then add = false end end if add then table.insert(word_list,str) end end function strip_spaces(str) while string.find(str, "% ") do str = string.gsub(str, " ","") end return str end function strip_symbols(str) local symbol_table = "'~()!?:> 0 do p = string.find(text,"\n",p+1) skip = skip - 1 end else break end end convo_end() -- 3.5 separation apply_html("html/spacer.html") -- fourth lets make word lists -- process contents content = strip_symbols(content) content = replace_symbols(content) content = revert_verbs(content) word_list = {} while string.find(content, " ") do add_word(string.sub(content, 0, string.find(content, " "))) content = string.sub(content, string.find(content, " ")+1) --print(string.find(content, " ")) end -- lets print the words apply_html("html/spacer.html") apply_html("html/words/start.html") for i=1, #word_list do print_word_stuff(word_list[i]) end apply_html("html/words/end.html") -- pop up apply_html("html/pop_up.html") -- lets end the html apply_html("html/end.html")