This module supports the accelerated entry creation gadget, WT:ACCEL. It automatically creates entries according to a set of language-specific rules, located in submodules.
The module will automatically try to merge multiple generated entries into one, if everything but the definitions is the same. Moreover, if the definitions use {{inflection of}}
, then the inflection tags will be combined into a single {{inflection of}}
definition line, separated by a semicolon ;
. In addition, the module will attempt to group multiple semicolon-separated tag sets in a single {{inflection of}}
call that differ in only one dimension, using multipart tags. For example, the following initially-generated entries
==Latin== ===Adjective=== {{head|la|adjective form|head=bonīs}} # {{inflection of|la|bonus||dat|m|p}} ===Adjective=== {{head|la|adjective form|head=bonīs}} # {{inflection of|la|bonus||dat|f|p}} ===Adjective=== {{head|la|adjective form|head=bonīs}} # {{inflection of|la|bonus||dat|n|p}} ===Adjective=== {{head|la|adjective form|head=bonīs}} # {{inflection of|la|bonus||abl|m|p}} ===Adjective=== {{head|la|adjective form|head=bonīs}} # {{inflection of|la|bonus||abl|f|p}} ===Adjective=== {{head|la|adjective form|head=bonīs}} # {{inflection of|la|bonus||abl|n|p}}
will first be grouped into one entry as follows:
==Latin== ===Adjective=== {{head|la|adjective form|head=bonīs}} # {{inflection of|la|bonus||dat|m|p}} # {{inflection of|la|bonus||dat|f|p}} # {{inflection of|la|bonus||dat|n|p}} # {{inflection of|la|bonus||abl|m|p}} # {{inflection of|la|bonus||abl|f|p}} # {{inflection of|la|bonus||abl|n|p}}
Then, the several inflection lines will be combined together into one:
==Latin== ===Adjective=== {{head|la|adjective form|head=bonīs}} # {{inflection of|la|bonus||dat|m|p|;|dat|f|p|;|dat|n|p|;|abl|m|p|;|abl|f|p|;|abl|n|p}}
Finally, the several tag sets in the single {{inflection of}}
call will be grouped into one tag set with multipart tags, like this:
==Latin== ===Adjective=== {{head|la|adjective form|head=bonīs}} # {{inflection of|la|bonus||dat//abl|m//f//n|p}}
The use of multipart tags like this helps by indicating where syncretism occurs and reduces the amount of information that must be processed. The algorithm to do the grouping is quite smart; it will only group when it won't change the semantics of the inflections, and there are multiple possible groupings that yield the same number of tag sets, the one with the fewest number of multipart tags is preferred. As an example of the latter, an entry like this::
==Latin== ===Adjective=== {{head|la|adjective form|head=bonum}} # {{inflection of|la|bonus||acc|m|s|;|nom|n|s|;|acc|n|s|;|voc|n|s}}
will be converted to the following:
==Latin== ===Adjective=== {{head|la|adjective form|head=bonum}} # {{inflection of|la|bonus||acc|m|s|;|nom//acc//voc|n|s}}
It could equally well be converted to the following, which also contains two tag sets:
==Latin== ===Adjective=== {{head|la|adjective form|head=bonum}} # {{inflection of|la|bonus||acc|m//n|s|;|nom//voc|n|s}}
However, this grouping is dispreferred because it results in two multipart tags, while the preferred grouping has only one.
The module uses a set of default rules which generate entries that should be acceptable in most cases:
{{head}}
, using the part-of-speech of the lemma plus "form", e.g. noun → noun form, adjective → adjective form, etc.
comparative
and superlative
, "comparative" and "superlative" are added to before the part of speech instead.{{inflection of}}
, and the form
tag is used directly as the form tag of the template. Thus, gen|s
→ {{inflection of|lang|...||gen|s}}
.p
→ {{plural of}}
f
→ {{feminine of}}
f|s
→ {{feminine singular of}}
m|p
→ {{masculine plural of}}
f|p
→ {{feminine plural of}}
comparative
→ {{comparative of}}
superlative
→ {{superlative of}}
These defaults may change in the future as Wiktionary's needs change. Don't rely on particular default values. If in doubt, assume that everything will use {{inflection of}}
, and override anything you want to be different.
First, consider whether new rules are needed at all. The default rules suffice for many cases, especially if you make sure to provide a value for the form
tag that can be directly inserted into {{inflection of}}
. If you really need language-specific rules, and are not able to edit the module yourself, please file requests for new features at the Grease Pit. Specify:
Generation rules are used to create the entry's contents. The general parts are defined in this module, while the language-specific rules are handled by submodules. Each submodule must return a table containing one function named generate
. This function has two parameters, params
and entry
, and it does not return any value.
The params
parameter is a table that contains the information about the lemma, the form-of entry to be created, and the acceleration tags. It contains the following values:
lang
pos
"noun"
or "verb"
. This is taken from whatever part-of-speech header preceded the template in the lemma entry. The default rule for creating the headword adds " form"
onto this, resulting in e.g. {{head|hi|noun form}}
.target
head=
parameter of the headword, if necessary (i.e. if different from target_pagename
). This is the same as target_pagename
in most cases, but can be different if the display form contains additional diacritics, as in languages such as Russian or Ukrainian (where the target will contain an acute accent marking the stress, if the word is more than one syllable) and Latin or Old English (where the target will contain macrons marking long vowels).target_pagename
form
"1|s|pres|ind"
. Occasionally it may be something else like "comparative"
. This comes from the .accel.form
field in a module invocation; the |accel-form=
parameter in a call to {{l}}
, {{m}}
or similar; or the |fNaccel-form=
parameter in a call to {{head}}
. See WT:ACCEL for more information.gender
nil
if no gender was explicitly given. This comes from the .accel.gender
field in a module invocation; the |accel-gender=
parameter in a call to {{l}}
, {{m}}
or similar; or the |fNaccel-gender=
parameter in a call to {{head}}
. See WT:ACCEL for more information.transliteration
nil
if no gender was explicitly given. This comes from the .accel.translit
field in a module invocation; the |accel-translit=
parameter in a call to {{l}}
, {{m}}
or similar; or the |fNaccel-translit=
parameter in a call to {{head}}
. See WT:ACCEL for more information. Note that this will only be specified for languages that use a non-Latin script, and only when the auto-generated transliteration is insufficient, incorrect or nonexistent.origin
.accel.lemma
field in a module invocation; the |accel-lemma=
parameter in a call to {{l}}
, {{m}}
or similar; or the |fNaccel-lemma=
parameter in a call to {{head}}
. Under normal circumstances, none of these parameters are explicitly given, in which case the value of this field is the same as origin_pagename
. (It will only differ from origin_pagename
when the lemma contains additional diacritics that are stripped in order to generate the pagename, as in Latin, Russian, Ancient Greek or Old English. See WT:ACCEL for more information.origin_pagename
origin_transliteration
nil
. This comes from the .accel.lemma_translit
field in a module invocation; the |accel-lemma-translit=
parameter in a call to {{l}}
, {{m}}
or similar; or the |fNaccel-lemma-translit=
parameter in a call to {{head}}
. The same considerations apply here as for transliteration
above. See WT:ACCEL for more information.The entry
parameter is essentially the return value of the function. It is a table that contains the different parts of the entry that is being created. Some of them will already have a default value when the language-specific function is run, while others are nil
by default. The purpose of the generation function for each language is to fill in these values, or override the defaults, so that the entry is generated according to what is needed for the language. The entry
table contains the following values:
pronunc
pos_header
head
{{head|(lang)|(pos) form}}
, with head=
and tr=
as necessary. You need to override this if you need something else.def
#
. By default, it uses {{inflection of|(lang)|(target)||(form)}}
, with tr=
as necessary. You need to override this if you need something else.inflection
, declension
, conjugation
mutation
altforms