This module generates {{Ancient Greek personal pronouns 1}}
and {{Ancient Greek personal pronouns 2}}
. Having a module link all the terms in the table is much faster than using a bunch of {{link}}
templates.
local export = {}
local U = require("Module:string/char")
local macron = U(0x304)
local breve = U(0x306)
local function make_edit_link(title)
local URL = tostring(mw.uri.fullUrl(title, "action=edit"))
return '<span class="plainlinks"></span>'
end
local pronoun_table_templates = {
= -- {{Ancient Greek personal pronouns 1}}
[=[{| class="wikitable" style="font-size: smaller; float: right;"
|+ ] pronoun <sup>(]=] .. make_edit_link("Module:grc-pronoun table") .. [=[)</sup>
! rowspan="2" | ] !! colspan="2" | ] !! ] !! ]
|-
! ] !! ] !! ] !! ]
|-
! ]
| {{{ἐγώ}}} || || {{{νώ}}}, {{{νῶϊ}}} || {{{ἡμεῖς}}}
|-
! ]
| {{{ἐμοῦ}}} || {{{μου}}} || {{{νῷν}}} || {{{ἡμῶν}}}
|-
! ]
| {{{ἐμοί}}} || {{{μοι}}} || {{{νῷν}}} || {{{ἡμῖν}}}
|-
! ]
| {{{ἐμέ}}} || {{{με}}} || {{{νώ}}}, {{{νῶϊ}}} || {{{ἡμᾶς}}}
|-
! colspan="5" |
|-
! ]
| {{{ἐμός}}} || || {{{νωΐτερος}}} || {{{ἡμέτερος}}}
|}]=],
= -- {{Ancient Greek personal pronouns 2}}
[=[{| class="wikitable" style="font-size: smaller; float: right;"
|+ ] pronoun <sup>(]=] .. make_edit_link("Module:grc-pronoun table") .. [=[)</sup>
! rowspan="2" | ] !! colspan="2" | ] !! ] !! ]
|-
! ] !! ] !! ] !! ]
|-
! ]
| {{{σύ}}} || || {{{σφώ}}}, {{{σφῶϊ}}} || {{{ῡ̔μεῖς}}}
|-
! ]
| {{{σοῦ}}} || {{{σου}}} || {{{σφῷν}}} || {{{ῡ̔μῶν}}}
|-
! ]
| {{{σοί}}} || {{{σοι}}} || {{{σφῷν}}} || {{{ῡ̔μῖν}}}
|-
! ]
| {{{σέ}}} || {{{σε}}} || {{{σφώ}}}, {{{σφῶϊ}}} || {{{ῡ̔μᾶς}}}
|-
! colspan="5" |
|-
! ]
| {{{σός}}} || || {{{σφωΐτερος}}} || {{{ῡ̔μέτερος}}}
|}]=],
}
function export.pronoun_table(frame)
local person = tonumber(frame.args)
if not person then
error('Parameter 1 should be a number.')
end
local template = pronoun_table_templates
or error('No template for person ' .. person .. '.')
local ugsub, decompose = mw.ustring.gsub, mw.ustring.toNFD
local function make_entry_name(text)
text = ugsub(decompose(text), "", "")
return text
end
local title = decompose(mw.title.getCurrentTitle().text)
local function link(term)
local entry_name = make_entry_name(term)
if entry_name ~= title then
return '<span class="Polyt" lang="grc">]</span>'
else
return '<strong class="selflink Polyt" lang="grc">' .. term .. '</strong>'
end
end
return (template:gsub('{{{(+)}}}', link))
end
return export