Module:RQ:pi:Sinhala Udana

This module is a data module providing a catalogue of passages from one particular book or article for each passage to demonstrate the existence of multiple Pali words. The modules returns a 3-D array (technically a Lua table), indexed as follows:

  1. The outer index is the page number.
  2. The second index is a character string serving as the name of the passage within the page - using the first word is the simplest scheme.
  3. The third index is an element number - the text (item 1), its transliteration (item 2) (optional) and its translation (item 3).

The table has one named element, "reference", that holds the name of the template (namely, {{RQ:pi:Sinhala Udana}}) used to identify the source to the reader and format the quote, its transliteration and its translation.

The intention is that the word will be highlighted when selected by these three indices. Words are assigned positive numbers and their boundaries are marked up in the form {number-word}. This mark up can be nested, so that words may contain other words. Different sections may have the same number; this allows for repeated words, overlapping words, and discontiguous translations.

The words are transcluded into a page using an invocation of the form {{RQ:pi:Sinhala Udana quote|148|sukho|6}}; this example produces the text:

c. 50 BC, the Buddha, anonymous author, translated by Ajahn Sujato, Udāna(pāḷi), page 148; republished as The Eighteenth Book in the Suttanta-Pitaka: Khuddaka-Nikāya[1], Colombo, 2009:
සුඛො විවෙකො තුට‍්ඨස‍්ස සුතධම‍්මස‍්ස පස‍්සතො
අබ්‍යාපජ‍්ජං සුඛං ලොකෙ පාණභූතෙසු සංයමො.
sukho viveko tuṭṭhassa sutadhammassa passato
abyāpajjaṃ sukhaṃ loke pāṇabhūtesu saṃyamo.
Seclusion is happiness for the contented
who see the teaching they have learned.
Kindness for the world is happiness
for one who’d not harm a living creature.

There is no advantage in including a passage for the sake of one word; one can use {{RQ:pi:Sinhala Udana}} directly for that purpose.


local data = {}
data.reference = "RQ:pi:Sinhala Udana"

data[148] = {
sukho = {
--"Sukho viveko tuṭṭhassa sutadhammassa passato<br/>"..
--"Abyāpajjaṃ sukhaṃ loke pāṇabhutesu saṃyamo."
	"{1-සුඛො} {2-විවෙකො} {3-තුට‍්ඨස‍්ස} {4-සුත}{10-ධම‍්මස‍්ස} {5-පස‍්සතො}<br/>"..
	"{6-අබ්‍යාපජ‍්ජං} {1-සුඛං} {7-ලොකෙ} {8-පාණභූතෙසු} {9-සංයමො}.", -- භු or භූ?
	"",
	"{2-Seclusion} is {1-happiness} for {3-the contented}<br/>"..
	"{5-who see} {10-the teaching} {4-they have learned}.<br/>"..
	"{6-Kindness} {7-for the world} is {1-happiness}<br/>"..
	"{9-for one who’d not harm} {8-a living creature}."
},
}

return data