Template:head/documentation

This template is used to create a basic headword line. This is the line of text that comes between the part-of-speech header (like ) and the actual definitions of the word.

Note that most invocations of should be fairly simple. If a language requires a relatively complex call to for many words (such as the same set of inflected forms in many entries, or using   in every entry), the language should probably have its own templates. Templates made specifically for a given language can be more sophisticated, and can handle inflections and other grammatical issues that are specific to that language. They can also make use of the capabilities of Lua modules. For this reason, keep in mind that the usage examples given on this page are for illustrative purposes only. Most of the languages given in the examples here already have their own sets of templates, such as, , , and so on.

However, can be used for words for which the basic usage (two or three parameters) is enough, or for languages that do not yet have their own templates. If you know how to make your own templates, it's recommended that you create some for the language you intend to work in before creating new entries, rather than using this template (and then having to replace it with a language-specific template later).

Parameters
A short reference of all parameters.
 * 1
 * The language code. See Languages.


 * sc
 * The script code. See Scripts. This is rarely needed as the script can generally be automatically detected.


 * 2
 * The part of speech category (such as "noun", "verb", "adjective" etc), which is used to add the entry to the appropriate category. This can be in either plural or singular form. In the latter case, the template will pluralise it automatically if it doesn't already end in -s. Exceptions can be added to the  list at the top of Module:headword/data if necessary.


 * head and head2, head3 ...
 * Overrides the headword that is displayed. This is used primarily to add diacritical marks or to link to individual words in a multi-word term. By default, if the page name has spaces in it, the words are split across the spaces, which is usually correct but may need overriding. Additional parameters are available if more than one headword needs to be shown.


 * tr and tr2, tr3 ...
 * Provides the transliteration for the term, see Transliteration. For many languages, this can be generated automatically so this does not need to be specified, but some entries cannot be reliably transliterated automatically (e.g. Arabic) so this parameter is necessary then. The additional parameters with a number correspond to each additional headword, pairwise.


 * g and g2, g3 ...
 * Provides gender/number specifications for the word, if necessary. See Module:gender and number for the format used.


 * cat2, cat3, cat4
 * Additional part-of-speech or other categories. Unlike the part-of-speech category in 2, these should always be in the plural.


 * 1
 * If given, don't automatically place the headword in a category based on the part of speech as given in 2. Normally, two categories are added, one based on the part of speech given (e.g. Category:Sanskrit nouns) and one based on the type of the part of speech, either lemma or non-lemma form (e.g. Category:Sanskrit lemmas). Specifying 1 will suppress both categories.


 * 1
 * If given, don't automatically place the headword in categories based on the gender(s). Normally, headwords with gender/number specifications given are placed in categories appropriate for the gender and number, e.g. Category:Sanskrit masculine nouns, Category:Russian animate nouns, Category:Czech imperfective verbs or Category:Spanish pluralia tantum.


 * 1
 * If given, don't automatically categorize multiword headwords. Normally, for most languages, headwords with multiple words are placed in a special category, e.g. Category:Sanskrit multiword terms. This is automatically suppressed for some languages, e.g. sign languages; languages without spaces between terms (such as Chinese, Japanese and Thai); or languages with spaces between syllables (such as Vietnamese). This is controlled by Module:headword/data.


 * 1
 * If given, don't automatically categorize palindromes. Normally, for most languages, palindromes are placed in a category like Category:English palindromes or Category:Hungarian palindromes. For some languages, there are language-specific rules for handling digraphs; for example, in Hungarian, gy, sz, zs and certain other combinations are treated like single letters for palindrome purposes, meaning that words like and  are considered palindromes. This can create problems, e.g.  would be categorized as a palindrome but is not because in this word, zs is two separate sounds rather than a digraph. Specifying 1 disables this categorization.


 * 1
 * If given, automatically add a category "(lang) (pos)es in (script) script" (e.g. Category:Sanskrit nouns in Devanagari script), for the script specified using sc or autodetected based on the value specified to head or the page name. This category is useful for languages that can be written in multiple scripts.


 * 1
 * If given, include automatic transliteration after each of the inflections specified using 3, 4 and further parameters (see below). This can also be set for individual inflected forms using fNautotr.


 * sort
 * The sort key to use when placing the entry in the above categories. This is rarely needed, as the default generated sort key is usually correct.


 * 3, 4 and further
 * Specifies inflected forms to show. These are specified pairwise, with the first giving the name of the form, and the second giving the form itself. So the forms are numbered like this: . If multiple forms exist for the same name, separate them by using " " as the name. Forms work the same as the 2nd parameter of, and can thus have embedded wikilinks, will have certain diacritics removed, and so on.
 * The following additional parameters are available for each form, with  replaced by the number of the form:
 * fNalt
 * Specifies the alternative display form of the inflected form, much like the 3rd parameter of.
 * fNtr
 * Specifies the transliteration of the inflected form, much like the tr parameter of.
 * fNsc
 * Specifies the script of the form, works like sc.
 * fNid
 * Specifies the sense ID to use for the link to the form's entry.
 * fNg
 * Provides gender/number specification(s) to display after the form. To include multiple specifications, separate them by commas. Uses the same gender/number specifications as for g.
 * fNqual
 * Specifies a qualifier that should appear before the form, formatted like the template does. This is used to mark certain forms as archaic, rare or similar.
 * The following parameters are available only for each name, meaning that if multiple forms are displayed for the same name (with " "), these parameters should use the number of the first form. They are automatically applied to all forms following that name.
 * fNaccel-form
 * Specifies an accelerated creation tag to be used by the WT:ACCEL gadget, to automatically generate an entry for a non-lemma form when the link is clicked. For information about acceleration tags, see WT:ACCEL. This should not be used directly in entries. If you find you need to use it, or any of the following acceleration-related parameters, you should probably make a custom template for the language instead. If the acceleration tag contains a vertical bar, use  instead.
 * fNaccel-translit
 * Specifies a manual transliteration of the non-lemma form for use with accelerated creation of entries; see WT:ACCEL and fNaccel-form above. The value of this parameter goes into param tr of the call to in the accelerated entry. You only need to specify this for languages that use a non-Latin script, and only when the auto-generated transliteration is insufficient, incorrect or nonexistent.
 * fNaccel-lemma
 * Specifies the lemma corresponding to the non-lemma form for use with accelerated creation of entries; see WT:ACCEL and fNaccel-form above. The value of this parameter goes into param 2 of the call to in the accelerated entry. It defaults to the name of the current page, and only needs to be specified when the lemma contains additional diacritics that are stripped in order to generate the pagename (as in Latin, Russian, Ancient Greek, Old English, etc.).
 * fNaccel-lemma-translit
 * Specifies a manual transliteration of the lemma corresponding to the non-lemma form for use with accelerated creation of entries; see WT:ACCEL and fNaccel-form above. The value of this parameter goes into param tr of the call to in the accelerated entry.  You only need to specify this for languages that use a non-Latin script, and only when the auto-generated transliteration is insufficient, incorrect or nonexistent.
 * fNaccel-gender
 * Specifies the gender of the non-lemma form for use with accelerated creation of entries; see WT:ACCEL and fNaccel-form above. The value of this parameter goes into param g of the call to in the accelerated entry. You should only rarely specify this.
 * 1
 * For use with accelerated creation of entries. Place this on links that appear in the collapsed state of collapsible tables; see WT:ACCEL.
 * 1
 * Inhibits automatic creation of a link to the forms. The forms will just be displayed in bold text instead. Links that are embedded into the form parameters are retained.
 * 1
 * Causes the page to be added to Category:Requests for inflections in LANG entries if a form is missing.
 * 1
 * Causes automatic transliteration to be included after each form.

Usage
The basic usage is:



The first parameter is the language code (see Languages), which is required in all cases. The second is the part of speech. For example on :



which produces

The part of speech is used to add a category to the page. So, the above code would also add the page to Category:Dutch prepositions.

Part of speech
The part of speech (second parameter) can be either singular or plural, and written out fully (e.g. ) or abbreviated (e.g.   or  ). If the part of speech is written out in full, it is stylistically preferred to write it in the singular.

The following part of speech aliases (abbreviations) are recognized by the module.

Displayed headword
Normally, the displayed headword is the same as the name of the current page. The parameter head can be used to specify a different headword to display. This can be useful if additional accent marks should be placed on the word, that are not present in the normal written form that is given in the page's name. For example, the Latin word is normally written that way, but is also spelled  in its fully accented form. For such a case, you would specify scrībō.

Another purpose of this parameter is for terms that consist of multiple words. The head parameter can be used to link to the individual words that the term is made up of. For example, for the English phrasal verb, you could use:



Note in the above example that the template automatically adds the correct language section to the links in the same way as. So the links    actually come out as if written. This means that you should not add such section links yourself, nor should you use inside the head parameter. These were necessary in the past, but they can now be safely removed.

In a few cases it may be necessary to show more than one headword. For example, a language like Russian might have a word with a single written form, but multiple alternative ways of placing the accent marks (compare this to English and ). Additional headwords can be displayed using the parameters head2, head3 and so on.

Transliteration
If a term is written in a script other than the Latin alphabet, a transliteration of the term into the Latin alphabet should be provided using the tr parameter. Every language generally has its own rules for writing transliterations on Wiktionary; check with the language's "About" page (such as About Russian) for more information.

The template can automatically transliterate words in many languages; this is controlled through special transliteration modules such as Module:el-translit (and also the data in Module:languages). This means that for those languages, a transliteration does not need to be provided, as it can be generated internally. If the head parameter was provided, it is used as the base for the transliteration instead, so that any additional accents are also included in the transliteration. Use - if you don't want a transliteration to be automatically generated (you shouldn't really ever do this in an entry).

Gender and number
The template has a set of parameters to display gender, number, noun class or other kinds of grammatical property. These are used and displayed in the standard format required by Module:gender and number.

The gender is given with the optional g parameter. If more than one specification is necessary, you can also use g2, g3 and so on. If you know that a gender is needed, but don't know what it is, specify ?, which will add the page to a cleanup category. You can also specify a partial gender. For example, if you know that a word is plural but don't know if it's, say, masculine or feminine plural, you can specify ?-p.

Inflections
Further optional parameters are available to display inflections or other closely related forms of the word. These are given pair-wise: the first of each pair gives a label for the inflection, and the second then gives the actual term.

For example, in the Sandbox:



Certain diacritics are automatically removed from the term when creating the link, just like and  do. So you don't need to worry about removing them yourself. A Latin example, where macrons are removed automatically:



If you want to display multiple alternative forms of an inflection, you can use  as the label separating them. The template will recognise this and omit the comma:



The term (second part of a pair) may be blank. This can be used to add a simple note, such as "uncountable" or "intransitive":



If the label is blank, but the term is not, it acts as if the term was not specified either and omits both. This is not very useful in entries, but it can be a very powerful feature when writing templates using as a base.

You can specify alternative display form, script, sense id and gender for each form with the parameters fNalt, fNsc, fNid and fNg, with "N" replaced with the number of the form. Some examples:









When using as a base to create other templates, the class for accelerated links (WT:ACCEL) can be added with fNaccel-form. See Module:headword for more information on how to use this. If the label is, the corresponding acceleration is ignored, and it is "inherited" from the preceding form. Examples:



An inflection term can contain wikilinks as part of the parameter, like the head parameter as well as the template. Language sections will be added to the individual links:



Naturally, you should only use this to display a single form that consists of multiple words. You should not use this to specify multiple alternative forms; use the  label for this instead.

Categories
There are a few more parameters available for categories:


 * sort specifies a category sort key. This is rarely needed, as by default, a sort key will be generated for the language according to the rules defined for that language in Module:languages (the  setting). For languages that have no sort key rules defined yet, the default sort key is the name of the page, with any hyphens removed from the beginning of the name.
 * cat2, cat3 and, cat4 specify additional category names that the page should be added to. The language's name is added in front, so if you use , the page will be added to both Category:English verbs and Category:English irregular verbs. Note that this parameter must be given in plural, unlike the part-of-speech parameter!

Script code
The optional parameter sc gives the script code (see Scripts). The script can usually be detected automatically based on the possibilities listed for the language in Module:languages, so this parameter is only needed in rare cases. The example below is thus only for illustrative purposes; a real example would not need sc here.

An example, for the entry, one might use:



{	"params": { "1": {			"label": "language code", "description": "The language code. See Languages.", "type": "line", "required": true },		"2": {			"label": "part of speech", "description": "The part of speech category which is used to add the entry to the appropriate category. This can be in either plural or singular form. In the latter case, the template will pluralise it automatically if it doesn't already end in -s. Exceptions can be added to the  list at the top of Module:headword/templates if necessary.", "type": "string", "example": "verb" },		"3": {			"label": "name of form 1", "description": "The name of a first of form of a term.", "type": "string" },		"4": {			"label": "form 1", "description": "A first form of the term.", "type": "string" },		"sc": { "label": "script code", "description": "The script code. See Scripts. This is rarely needed as the script can generally be automatically detected." },		"cat sc": { "label": "script code with category", "description": "The same as sc, but this also adds \"in (name) script\" to the category specified by the second parameter below. This is used to subcategorise words in different scripts, if languages can be written in more than one script. If both sc and cat sc are provided, the latter takes precedence.", "type": "string" },		"cat2": { "label": "part of speech category 2", "description": "Additional part-of-speech categories. Unlike the, these should always be in plural.", "type": "string" },		"cat3": { "label": "part of speech category 3", "description": "Additional part-of-speech categories. Unlike the, these should always be in plural.", "type": "string" },		"sort": { "label": "sort key", "description": "The sort key to use when placing the entry in the above categories. This is rarely needed, as the default generated sort key is usually correct.", "type": "string" },		"head": { "description": "Overrides the headword that is displayed. This is used primarily to add diacritical marks or to link to individual words in a multi-word term. By default, if the page name has spaces in it, the words are split across the spaces, which is usually correct but may need overriding. Additional parameters are available if more than one headword needs to be shown.", "type": "string" },		"head2": { "description": "Additional term for the headword display.", "type": "string" },		"head3": { "description": "Additional term for the headword display.", "type": "string" },		"head4": { "description": "Additional term for the headword display.", "type": "string" },		"head5": { "description": "Additional term for the headword display.", "type": "string" },		"tr": { "description": "Provides the transiteration for the term, see Transliteration. For many languages, this can be generated automatically so this does not need to be specified, but some entries cannot be reliably transliterated automatically (e.g. Arabic) so this parameter is necessary then.", "type": "string" },		"tr2": { "description": "Provides the transiteration for the term, should match .", "type": "string" },		"tr3": { "description": "Provides the transiteration for the term, should match .", "type": "string" },		"tr4": { "description": "Provides the transiteration for the term, should match .", "type": "string" },		"tr5": { "description": "Provides the transiteration for the term, should match .", "type": "string" },		"g": { "description": "Provides gender specifications for the word, if necessary. See Module:gender and number for the format used.", "type": "string" },		"g2": { "description": "Provides gender specifications for the word, if necessary, should match .", "type": "string" },		"g3": { "description": "Provides gender specifications for the word, if necessary, should match .", "type": "string" },		"g4": { "description": "Provides gender specifications for the word, if necessary, should match .", "type": "string" },		"g5": { "description": "Provides gender specifications for the word, if necessary, should match .", "type": "string" }	},	"description": "This template is used to create a basic headword line. This is the line of text that comes between the part-of-speech header (like ) and the actual definitions of the word. ", "paramOrder": [ "1",		"2",		"sc", "cat sc", "cat2", "cat3", "sort", "head", "head2", "head3", "head4", "head5", "tr", "tr2", "tr3", "tr4", "tr5", "g", "g2", "g3", "g4", "g5", "3",		"4"	],	"format": "inline" }