--Update: this module is no longer in production use. The test was modestly
--successful, but a more general solution is desired.
--This module is a temporary test to see if adding invisible Romanisations will
--render Greek words more searchable in the Wiktionary search box and via
--external search engines. If it seems undesirable or does not work it will be
--removed within a week or so. Currently, this test applies only to nouns. At
--this point, an unknown time interval is likely necessary for the changes to
--propagate to all of the relevant places. --5 July 2015
local accent_m = require("Module:grc-accent")
local export = {}
local PHUCH = { ="A",="B",="G",="D",="E",="V",="Z",="E",="Th",="I",="K",="L",="M",="N",="X",="O",="P",="R",="S",="T",="U",="Ph",="Ch",="Ps",="O",="a",="b",="g",="d",="e",="v",="z",="e",="th",="i",="k",="l",="m",="n",="x",="o",="p",="r",="s",="s",="t",="u",="ph",="ch",="ps",="o"}
local PHYCH = { ="A",="B",="G",="D",="E",="V",="Z",="E",="Th",="I",="K",="L",="M",="N",="X",="O",="P",="R",="S",="T",="Y",="Ph",="Ch",="Ps",="O",="a",="b",="g",="d",="e",="v",="z",="e",="th",="i",="k",="l",="m",="n",="x",="o",="p",="r",="s",="s",="t",="y",="ph",="ch",="ps",="o"}
local FUCH = { ="A",="B",="G",="D",="E",="V",="Z",="E",="Th",="I",="K",="L",="M",="N",="X",="O",="P",="R",="S",="T",="U",="F",="Ch",="Ps",="O",="a",="b",="g",="d",="e",="v",="z",="e",="th",="i",="k",="l",="m",="n",="x",="o",="p",="r",="s",="s",="t",="u",="ph",="ch",="ps",="o"}
local FYCH = { ="A",="B",="G",="D",="E",="V",="Z",="E",="Th",="I",="K",="L",="M",="N",="X",="O",="P",="R",="S",="T",="Y",="Ph",="Ch",="Ps",="O",="a",="b",="g",="d",="e",="v",="z",="e",="th",="i",="k",="l",="m",="n",="x",="o",="p",="r",="s",="s",="t",="y",="ph",="kh",="ps",="o"}
local PHUKH = { ="A",="B",="G",="D",="E",="V",="Z",="E",="Th",="I",="K",="L",="M",="N",="X",="O",="P",="R",="S",="T",="U",="Ph",="Kh",="Ps",="O",="a",="b",="g",="d",="e",="v",="z",="e",="th",="i",="k",="l",="m",="n",="x",="o",="p",="r",="s",="s",="t",="u",="ph",="kh",="ps",="o"}
local PHYKH = { ="A",="B",="G",="D",="E",="V",="Z",="E",="Th",="I",="K",="L",="M",="N",="X",="O",="P",="R",="S",="T",="Y",="Ph",="Kh",="Ps",="O",="a",="b",="g",="d",="e",="v",="z",="e",="th",="i",="k",="l",="m",="n",="x",="o",="p",="r",="s",="s",="t",="y",="ph",="kh",="ps",="o"}
local FUKH = { ="A",="B",="G",="D",="E",="V",="Z",="E",="Th",="I",="K",="L",="M",="N",="X",="O",="P",="R",="S",="T",="U",="F",="Kh",="Ps",="O",="a",="b",="g",="d",="e",="v",="z",="e",="th",="i",="k",="l",="m",="n",="x",="o",="p",="r",="s",="s",="t",="u",="ph",="kh",="ps",="o"}
local FYKH = { ="A",="B",="G",="D",="E",="V",="Z",="E",="Th",="I",="K",="L",="M",="N",="X",="O",="P",="R",="S",="T",="Y",="Ph",="Kh",="Ps",="O",="a",="b",="g",="d",="e",="v",="z",="e",="th",="i",="k",="l",="m",="n",="x",="o",="p",="r",="s",="s",="t",="y",="ph",="kh",="ps",="o"}
local beta = { ="A",="B",="G",="D",="E",="V",="Z",="H",="Q",="I",="K",="L",="M",="N",="C",="O",="P",="R",="S",="T",="U",="F",="X",="Y",="W",="a",="b",="g",="d",="e",="v",="z",="h",="q",="i",="k",="l",="m",="n",="c",="o",="p",="r",="s",="s",="t",="u",="f",="x",="y",="w"}
local ts = { PHUCH, PHYCH, FUCH, FYCH, PHUKH, PHYKH, FUKH, FYKH, beta }
function t1(t, w)
local gs = {}
for i = 1, mw.ustring.len(w) do gs = t or mw.ustring.sub(w, i, i) end
return table.concat(gs)
end
function print_transliterations(head)
w = accent_m.strip_accent(head)
local us, html = {}, {'<span style="visibility: hidden"> '}
for i,t in ipairs(ts) do
us = {} end
for u,x in pairs(us) do
html = u
html = " " end
html = ' may be Romanised forms of Ancient Greek '..head..'.</span>'
return table.concat(html)
end -- e.g., appends to the headword for χρόνος this: <span style="visibility: hidden">khronos xronos chronos may be Romanised forms of Ancient Greek χρόνος.</span>
function export.ascii(frame)
local args = frame:getParent().args
local head = args or mw.title.getCurrentTitle().text
return print_transliterations(head)
end
return export