Module:RQ:pi:Sinhala Majjhimanikaya 2

From Wiktionary, the free dictionary
Jump to navigation Jump to search

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 Majjhimanikaya 2}}) 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 Majjhimanikaya 2 quote|558|bhutapubbaham|31}}; this example produces the text:

2006, The Fifth Book in the Suttanta-Pitaka: Majjhimanikāya (II)[1], page 558:
භූතපුබ‍්බාහං
භන‍්තෙ සෙනං අබභූය්‍යානො සමානො ඉමෙව ඉසිදත‍්තපුරාණා
ථපතයො වීමංසමානො අඤ‍්ඤතරස‍්මිං සම‍්බාධෙ ආවසථෙ වාසං
උපගඤ‍්ඡිං.
Bhūtapubbāhaṃ
bhante senaṃ abbhūyyāno samāno imeva isidattapurāṇā
thapatayo vīmaṃsamāno aññatarasmiṃ sambādhe āvasathe vāsaṃ
upagañchiṃ.
Once, sir, while I was leading the army on campaign and at the same time testing these self-same chamberlains Isidatta and Purāṇa I took up residence in a certain cramped house.

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


data = {}
data.reference = "RQ:pi:Sinhala Majjhimanikaya 2"
data.lang = 'pi'

-- Authoritative source:
-- http://www.aathaapi.net/tipitaka/10.OTSPDN1_Deegha_Nikaya_1.pdf

-- Series info:
-- https://tipitaka.wordpress.com/2007/05/21/buddhajayanthi-edition/

-- Copiable text, to be corrected (nearly all Sinhala consonant clusters are wrong!):
-- https://www.tipitaka.org/sinh/

-- Transliteration source (to be verified - there are small differences):
-- https://www.tipitaka.org/romn/
-- Path: Tipiṭaka (Mūla), Vinayapiṭaka, Suttapiṭaka, Majjhimanikāya

--Page number is from the Sinhala edition.

-- Translation source:
-- https://suttacentral.net/mnxx/en/sujato for Sutta xx.
-- Adapted for context and to better display words.

-- Sutta 89 (Numbered 2.4.9 in book)
data[558] = { -- p.558
--Paragrpah start here.
	punacaparam = {
		"{1-{2-පුන} {3-ච} {4-පරං}} {5-භන‍්තෙ}, "..
		"{6-ඉමෙ} {43-{7-ඉසිදත‍්ත}{8-පුරාණා}} {9-ථපතයො} {44-{10-මම}}{11-භත‍්තා}<br/>"..
		"{44-{10-මම}}{12-යානා} {44-{13-අහං}} {14-නෙසං} {15-ජීවිතස‍්ස} {16-පදාතා} "..
		"{17-යසස‍්ස} {18-ආහත‍්තා} {19-{20-අථ} {3-ච} {21-පන}}<br/>"..
		"{22-නො} {23-තථා} {44-{24-මයි}} {25-නිපච‍්චාකාරං} {26-කරොන‍්ති} "..
		"{27-යථා} {28-භගවති}. ",
		"{1-{2-Puna} {3-ca} {4-paraṃ}} {5-bhante}, "..
		"{6-ime} {43-{7-isidatta}{8-purāṇā} {9-thapatayo}} {44-{10-mama}}{11-bhattā}<br/>"..
		"{44-{10-mama}}{12-yānā} {44-{13-ahaṃ}} {14-nesaṃ} {15-jīvitassa} {16-padātā} "..
		"{17-yasassa} {18-āhattā} {19-{20-atha} {3-ca} {21-pana}}<br/>"..
		"{22-no} {23-tathā} {44-{24-mayi}} {25-nipaccākāraṃ} {26-karonti} "..
		"{27-yathā} {28-bhagavati}.",
		"{1-Furthermore}, {30-sir}, {6-these} {43-{9-chamberlains} "..
		"{7-Isidatta} and {8-Purāṇa}} share {44-{10-my}} {11-meals} and "..
		"{44-{10-my}} {12-carriages}.  {44-{13-I}} {16-give} {14-them} "..
		"{15-a livelihood} and {18-bring} {14-them} {17-renown}. "..
		"{19-{3-And} yet} {26-they} {22-don’t} {26-show} {44-{24-me}} "..
		"{23-the same level of} {25-devotion} {27-that} {26-they show} "..
		"{28-to the Buddha}."
	},
	bhutapubbaham = {
		"{29-භූතපු{13-බ‍්බා}}{13-හං}<br/>"..
		"{30-භන‍්තෙ} {31-සෙනං} {32-අබභූය්‍යානො} {33-සමානො} "..
		"{34-ඉ{35-මෙ}}{35-ව} {43-{7-ඉසිදත‍්ත}{8-පුරාණා}}<br/>"..
		"{9-ථපතයො} {36-වීමංසමානො} {37-අඤ‍්ඤතරස‍්මිං} {38-සම‍්බාධෙ} "..
		"{39-ආවසථෙ} {40-{41-වාසං}<br/>{42-උපගඤ‍්ඡිං}}.",
		"{29-Bhūtapubb}{13-{29-ā}haṃ}<br/>"..
		"{30-bhante} {31-senaṃ} {32-abbhūyyāno} {33-samāno} "..
		"{34-im{35-e}}{35-va} {43-{7-isidatta}{8-purāṇā}<br/>"..
		"{9-thapatayo}} {36-vīmaṃsamāno} {37-aññatarasmiṃ} {38-sambādhe} "..
		"{39-āvasathe} {40-{41-vāsaṃ}<br/>{42-upagañchiṃ}}.",
-- {30-}{29-Once it so happened that while} {13-I} {32-was leading} {31-a military campaign} {33-and} {36-testing} {43-{7-Isidatta} and {8-Purāṇa}}{34-}{35-} {40-{42-I took up} {41-residence}} {39-in} {37-a certain} {38-cramped} {39-house}.
		"{29-Once}, {30-sir}, {19-while} {13-I} {32-was leading} {31-the army} "..
		"{32-on campaign} {33-and at the same time} {36-testing} {34-these} "..
		"{35-self-same} {43-{9-chamberlains} {7-Isidatta} and {8-Purāṇa}} "..
		"{40-{42-I took up} {41-residence}} {39-in} {37-a certain} "..
		"{38-cramped} {39-house}."
	}
}
	
return data