Module:pra-decl/noun/documentation

From Wiktionary, the free dictionary
Jump to navigation Jump to search
Documentation for Module:pra-decl/noun. [edit]
This page contains usage information, categories, interwiki links and other content describing the module.

Purpose[edit]

This module provides inflection tables for Prakrit for nouns, adjectives and potentially some pronouns. For pronouns, one currently uses the interface for nouns, while for adjectives one uses separate invocations for each gender. The script of the inflected forms is the one used for the stem.

Some functions are exported from this module to service the testing of noun inflection.

Normal Use[edit]

The normal way to use this module is to invoke a dialect-specific template. This invokes a dialect-specific exported function, which see for the interface. This invokes the internal function show.

Dialect Template Function Code Data table
Ardhamagadhi {{pra-ard-decl-noun}} pra_ard() pra-ard Module:pra-decl/noun/pra-ard
Maharashtri {{pra-mah-decl-noun}} pra_mah() pra-mah Module:pra-decl/noun/pra-mah
Magadhi {{pra-mag-decl-noun}} pra_mag() pra-mag Module:pra-decl/noun/pra-mag
Sauraseni {{pra-sau-decl-noun}} pra_sau() pra-sau Module:pra-decl/noun/pra-sau

The Ardhamagadhi data table has not yet been written, and the Magadhi data table does not include the feminine declensions.

Data Modules[edit]

The data modules are for use on stems written in a slight customisation of IAST.

The data modules export a Lua table indexed by the final stem vowel and gender. The same value may be used for slightly different final vowels. These values are arrays for 16 different case/number combinations, and their values are an array of endings for that combination.

A stem and an ending are combined by the following rules, implemented in function joinSuffix:

  1. For each '⌫' at the start of the ending, delete one character from the stem.
  2. Append the juncture marker 'Ⓙ' to the remains of the stem.
  3. Append the rest of the ending to the modified stem.
  4. Make adjustments at the junctures. For the initial use of the juncture marker, this consisted of adding diaereses when abutting vowels could be confused with diphthongs.
  5. Remove remaining juncture markers.
  6. Convert the result to the appropriate script.

Note that the tables follow the Hindu identification rules for the cases, which differ from the Pali rules. Thus, while in Pali the case forms used for the ablative plural and the dative are mostly the same as for the instrumental plural and dative, in Prakrit such forms are not categorised by their functions but are rather assigned to the instrumental plural or genitive according to their forms.

Other Exported Functions[edit]

The following Lua functions are also exported by this module:

  • select
  • joinSuffix
  • show

Function endings, stem = select(dialect, word, g, etc)[edit]

The primary purpose is to return the endings for the word and gender (g, they are returned in return value endings. The argument etc is a table which contains the script object in field sc and should contain arguments other than the word and its gender. The function may append other items and preprocessed data. This table should be passed to subsequent invocations of joinSuffix.

The word word is transliterated to the Roman script as function value stem. Special treatment is applied if it contains a trailing combining diaeresis.

This function is also used by Module:pra-decl/noun/testcases.

Function joinSuffix(frame, stem, suffixes, etc)[edit]

This function returns the contents of a cell of the declension table. It returns the wikicode for a cell of the declension table, with the inflected forms in the appropriate script.

The argument frame is a frame variable. Any frame variable will suffice. The argument stem is the Roman script stem as returned by select(). The argument suffixes is an array of endings, also in the Roman script.

The argument etc is a table of arguments affecting the combination of stem and suffixes. In particular, it shall contains the field sc as the script object for the script the inflected forms are to be displayed in. This argument should normally be as modified by function select().

This function is also used by Module:pra-decl/noun/testcases.

Function show(frame, dialect)[edit]

This function coordinates the preparation of a table. It can only be called from Lua code. It should probably not be exported.

Exported variables[edit]

The variable orJoin is the string used to join forms listed in a cell of the declension table. It should be treated as a constant.

The variable is also used by Module:pra-decl/noun/testcases.