Module:grc-correlatives
Jump to navigation
Jump to search
- The following documentation is located at Module:grc-correlatives/documentation. [edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
This module generates {{grc-correlatives}}
. Having a module link all the terms in the table is much faster than using a bunch of {{link}}
templates, and using simple tagging and linking functions is much faster than using Module:script utilities and Module:links.
local ugsub = mw.ustring.gsub
local decompose = mw.ustring.toNFD
local U = require("Module:string/char")
local macron = U(0x304)
local breve = U(0x306)
local export = {}
local function make_edit_link(title)
local URL = tostring(mw.uri.fullUrl(title, "action=edit"))
return '<span class="plainlinks">[' .. URL .. ' edit]</span>'
end
-- Here, anything in template parameter notation, {{{thingy}}}, will be linked
-- with no transliteration, like {{l|grc|thingy|tr=-}}.
local template =
[=[
<div class="NavFrame">
<div class="NavHead" align="left">[[Appendix:Ancient Greek correlatives|Ancient Greek correlatives]] <sup>(]=] .. make_edit_link("Module:grc-correlatives") .. [=[)</sup></div>
<div class="NavContent" align="center">
{| class="wikitable"
! type !! interrogative !! indefinite !! (medial)<br/>demonstrative !! proximal<br/>demonstrative !! distal<br/>demonstrative !! relative !! indefinite<br/>relative !! identity !! other
|-
! basic
| {{{τίς}}} || {{{τις}}}, {{{ἔνιοι}}} || †{{{ὁ}}}, {{{οὗτος}}} || {{{ὅδε}}} || {{{ἐκεῖνος}}} || {{{ὅς}}} || {{{ὅστις}}} || {{{[[ὁ]] [[αὐτός]]}}} ({{{αὑτός}}}), {{{ὁμός}}} || {{{ἕτερος}}}, {{{ἄλλος}}}
|-
! dual
| {{{πότερος}}} || {{{πότερος}}}, {{{ποτερός}}} || || || || colspan="2" | {{{ὁπότερος}}} || ||
|-
! quality
| {{{ποῖος}}} || {{{ποιός}}} || †{{{τοῖος}}}, {{{τοιοῦτος}}} || {{{τοιόσδε}}} || <!-- ἐκείνινος, of that material, not quite correlative --> || {{{οἷος}}} || {{{ὁποῖος}}} || {{{ὅμοιος}}} || {{{ἑτεροῖος}}}, {{{ἀλλοῖος}}}
|-
! quantity
| {{{πόσος}}} || {{{ποσός}}} || †{{{τόσος}}}, {{{τοσοῦτος}}} || {{{τοσόσδε}}} || || {{{ὅσος}}} || {{{ὁπόσος}}} || ||
|-
! manner
| {{{πῶς}}} || {{{πως}}} || †{{{τώς}}}, †{{{ὥς}}}, {{{οὕτως}}} || {{{ὧδε}}} || || {{{ὡς}}} || {{{ὅπως}}} || {{{ὁμῶς}}} || {{{ἑτέρως}}}, {{{ἄλλως}}}
|-
! method,<br>path,<br>place
| {{{πῇ}}} || {{{πῃ}}} || {{{τῇ}}}, {{{ταύτῃ}}} || {{{τῇδε}}} || {{{ἐκείνῃ}}} || {{{ᾗ}}} || {{{ὅπῃ}}} || || {{{ἄλλῃ}}}
|-
! place
| {{{ποῦ}}}, †{{{πόθι}}} || {{{που}}}, †{{{ποθι}}} || {{{ἐνταῦθα}}} || {{{ἐνθάδε}}} || {{{ἐκεῖ}}}, {{{ἔνθα}}}, †{{{ἐκεῖθι}}} || {{{οὗ}}}, {{{ἔνθα}}}, †{{{ὅθι}}} || {{{ὅπου}}}, †{{{ὁπόθι}}} || {{{αὐτόθι}}}, {{{ὁμοῦ}}} || {{{ἄλλοθι}}}
|-
! source
| {{{πόθεν}}} || {{{ποθεν}}} || †{{{τόθεν}}}, {{{ἔνθεν}}}, {{{ἐντεῦθεν}}} || {{{ἐνθένδε}}} || {{{ἐκεῖθεν}}} || {{{ὅθεν}}} || {{{ὁπόθεν}}} || †{{{ὁμόθεν}}} || {{{ἄλλοθεν}}}
|-
! destination
| {{{ποῖ}}}, †{{{πόσε}}} || {{{ποι}}} || {{{ἔνθα}}}, {{{ἐνταῦθα}}} || {{{ἐνθάδε}}}<!-- displaced by δεῦρο as destination demonstrative? -->, {{{δεῦρο}}}<!-- δεῦρο not really correlative? --> || {{{ἐκεῖσε}}} || {{{οἷ}}} || {{{ὅποι}}}, †{{{ὁπόσε}}} || {{{αὐτόσε}}}, {{{ὁμόσε}}} || {{{ἄλλοσε}}}
|-
! time
| {{{πότε}}}, {{{πῆμος}}} || {{{ποτέ}}}, {{{ποτε}}}, {{{τοτέ}}}, {{{ἐνίοτε}}} || {{{τότε}}}, {{{τῆμος}}} || {{{τημόσδε}}} || || {{{ὅτε}}}, {{{ἦμος}}} || {{{ὁπότε}}}, †{{{ὁππῆμος}}} || {{{ἅμα}}} || {{{ἄλλοτε}}}
|-
! exact time
| {{{πηνίκα}}} || || †{{{τηνίκα}}}, {{{τηνικαῦτα}}} || {{{τηνικάδε}}} || || {{{ἡνίκα}}} || {{{ὁπηνίκα}}} || {{{αὐτίκα}}} ||
|-
! duration of time
| || || {{{τέως}}} || || || {{{ἕως}}} || || ||
|-
! size, age
| {{{πηλίκος}}} || {{{πηλίκος}}} || †{{{τηλίκος}}}, {{{τηλικοῦτος}}} || {{{τηλικόσδε}}} || || {{{ἡλίκος}}} || {{{ὁπηλίκος}}} || {{{ὁμῆλιξ}}} ||
|-
! repetition
| {{{ποσάκις}}}, {{{ποσίνδα}}} || {{{ποσάκις}}} || {{{τουτάκις}}}, {{{τοσάκις}}} || || || †{{{ὁσάκις}}} {{{ὁποσάκις}}} || {{{ὁποσάκις}}} || ||
|-
! multiplication
| {{{ποσαπλάσιος}}} || || || || || {{{ὁσαπλάσιος}}}, {{{ὁσαπλασίων}}} || || ||
|-
! order
| {{{πόστος}}} || {{{ποστός}}} || || || || || {{{ὁπόστος}}} || <!-- πολλοστός far along in the ordinal series --> ||
|-
| colspan="10" | † Forms rarely or never used in Classical Attic prose<br/>Relative also used in exclamations;<!-- Smyth section 2682 --> either relative or indefinite relative used in indirect questions.
|}</div></div>]=]
function export.show(frame)
if next(frame.args) then
error("This module function does not require any parameters.")
end
local function make_entry_name(text)
text = ugsub(decompose(text), "[" .. macron .. breve .. "]", "")
return text
end
local title = decompose(mw.title.getCurrentTitle().text)
local function link_or_not(text)
if text:find("[[", 1, true) then
return text:gsub("%[%[([^%]]+)%]%]", link_or_not)
else
local entry_name = make_entry_name(text)
if entry_name ~= title then
return '[[' .. entry_name .. '#Ancient Greek|' .. text .. ']]'
else
return '<strong class="selflink">' .. text .. '</strong>'
end
end
end
local function tag(text)
return '<span class="Polyt" lang="grc">' .. link_or_not(text) .. '</span>'
end
return (template:gsub('{{{([^}]+)}}}', tag))
end
return export