Module:RQ:pi:PTS Anguttara Nikaya 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:PTS Anguttara Nikaya 2}}) used to identify the source to the reader and format the quote, its transliteration and its translation. The table structure allows fields lang, p1 and p2 for uninterpreted passage to the reference template to customise its output. This particular module's table uses p1 as the the name of the vagga containing the quotation. The field applied to the innermost of the passage, page and table is the value passed on.

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:PTS Anguttara Nikaya 2 quote|215|paccakkosati|4}}; this example produces the text:

c. 50 BC, Anguttara Nikaya: Book of Fours, Mahā Vagga; republished as Richard Morris, editor, Aṅguttara-Nikāya: Part II: Catukka Nipāta[1], London: Pali Text Society, 1888, page 215:
Idha bhikkhave bhikkhu akkosantaṃ paccakkosati, rosantaṃ paṭirosati, bhaṇḍantaṃ paṭibhaṇḍati.
Mendicants, it’s when someone abuses, annoys, or argues with a mendicant, and the mendicant abuses, annoys, or argues back at them.

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


data = {}
data.reference = "RQ:pi:PTS Anguttara Nikaya 2"
-- This module uses p1 to name the vagga.

data[215] = {
	p1 = "Mahā Vagga",
	paccakkosati = {
		"{1-Idha} {2-bhikkhave} {3-bhikkhu} {4-akkosantaṃ}} {5-paccakkosati}, "..
			"{6-rosantaṃ} {7-paṭirosati}, {8-bhaṇḍantaṃ} {9-paṭibhaṇḍati}.",
		"",
		"{2-Mendicants}, {1-it’s when} {4-{6-{8-someone}}} {4-abuses}, {6-annoys}, or {8-argues} "..
			"{3-with a mendicant, and the mendicant} {5-abuses}, {7-annoys}, or {9-argues} "..
			"{5-{7-{9-back}}} {4-{6-{8-at them}}}."
	}
}	

return data