Module:sa-verb/testcases/documentation

This is primarily intended as a "test suite for Sanskrit verb conjugations based off of Whitney".

To this end, it is designed to compare the conjugation of verbs as documented in Whitney with the conjugation generated by Module:sa-verb without specific form overrides. For forms and tenses generated by the module, specific form overrides can always bring the Devanagari to the desired form, so there is limited point in testing the outcome of such overrides.

The data to be compared against is laid out in tables within this module with names such as lua, with subtables for each tense/mood and voice, namely:

The named subtables are all optional. The subtables for the participles are lists of alternative 'lemmas', while the subtables contain 9 number lists of forms for the 9 person-number combinations, 1s, 1du, 1p, 2s, 2du, 2p, 3s, 3du and 3p, in that order. All subtables and lists may contain named strings lua explaining why the form given is the correct form and lua explaining why the generated form is correct instead. These are displayed if a test fails.

To better detect errors in the module, the concept of the 'regular' forms of a verb is supported. The version of a named subtable containing only the regular forms is as above but suffixed with '_reg'. The function lua returns the table with such subtables replacing the full subtable.

The individual test results are laid out in tables grouped by test function, with the 'text' column giving a 'label', principally the first non-positional parameter shorn of stem override, and the part of the verb being compared. The label includes an accent if the forms being compared are to have Vedic accents, and does not it they are not to. For finite forms, all forms, active and middle, of the same person are compared in a single test, and for non-finite forms, all alternative forms are compared together. When what is being compared with is the regular forms of the verb, the label will contain the word 'regularised'.

There are a number of flags that influence the generation of the forms in the generated inflection tables. These are recorded in a 'header' line in the results table immediately prior to the affected texts. These fall into three groups:

1. The stem overrides:

2. Flag options. These correspond to options exposed by sa-conj, and are: set, j_to_z, h_to_g, diaspirate and aor.

3. Postprocessing options:

The tests are grouped by tense system and, for the present system, by class. The groups are displayed in alphabetic order.