Module:en-headword/documentation

This module is used for English headword-line templates. This module currently implements en-noun, en-proper noun, en-verb, en-adj, en-adv, en-intj and en-con (for conjunctions). See the documentation of those templates for more information. Other English headword templates are in the process of being converted to use this module.

The module is always invoked the same way, by passing a single parameter to the "show" function. This parameter is the name of the part of speech, but in plural (examples given are for nouns, and for adjective forms respectively):

The template will, by default, accept the following parameters (specific parts of speech may accept or require others):


 * head, head2, head3, ...
 * Override the headword display; used to add links to individual words in a multiword term.


 * id
 * Sense ID for linking to this headword. See senseid for more information.


 * 1 or 1
 * Don't link individual words in the headword of a multiword term. Useful for foreign or otherwise unanalyzable terms like and  where the expression functions as a whole in English but the individual parts are not English words.


 * 1
 * Indicate that automatic splitting and linking of words should split on hyphens in multiword expressions with spaces in them, even if the hyphenated component would normally be linked as-is or with hyphens converted to spaces. See below.


 * 1
 * Indicate that automatic splitting and linking of words should not split on hyphens in multiword expressions with spaces in them, even if this would normally happen. See below.


 * 1
 * Indicate that hyphenated components should be linked as a whole using the space-separated equivalent, even if this would not normally happen (i.e. because the space-separated equivalent is not defined as an English term). See below.


 * 1
 * Prevent terms beginning with a hyphen from being interpreted as suffixes. See below.


 * 1
 * Prevent multiword terms (those with spaces or with hyphens in the middle) from being added to Category:English multiword terms.


 * pagename
 * Override the page name used to compute default values of various sorts. Useful when testing, for documentation pages, etc.


 * sort
 * Sort key. Rarely needs to be specified, as it is normally automatically generated.

Autosplitting
All templates using this module use an intelligent autosplitting algorithm to link portions of multipart and multiword expressions, as follows:
 * If there are spaces in the term but no apostrophes or hyphens, the module will automatically split and link distinct space-separated words, similarly to head; hence, will be linked as.
 * If there are spaces and apostrophes but no hyphens, the module will likewise split and link distinct space-separated words, but may also split up words with apostrophes in them. Specifically:
 * If a word ends in, the part before the   will be linked as a word, and the   will be linked separately to , on the assumption that the   is functioning as a possessive. For example,  will be linked as  . (An exception is made for , , ,  and , which are linked as-is without splitting.)
 * If a word ends in, the apostrophe will be linked to  (on the assumption that the   is functioning as a plural possessive, similarly to above), and the part before will be separately linked. If the part before ends in an  , the module converts it to its singular equivalent and looks that up to see if it exists and has a definition as an English term. If so, the term is linked to the singular form; otherwise, it is linked to the plural form. (Converting to the singular means that   becomes  ;   is dropped after  ,   and  ; and otherwise   is dropped.) For example,  will be linked as   because  exists as an English term, but  will be linked as   because  does not exist as an English term.
 * All other terms containing apostrophes are linked unsplit.
 * If there are hyphens in the term but no spaces or apostrophes, the hyphenated components will be linked individually. For example, will be linked as.
 * An exception to this occurs with certain recognized prefixes, which are linked with the hyphen included in the prefix. For example, is linked as   and  is linked as , because  and  are in the list of recognized prefixes. (For the full list, see below.)
 * If there are hyphens and apostrophes but no spaces, the effect is similar to the situation with spaces and apostrophes. For example, is linked as.
 * If there are both hyphens and spaces, the space-separated components that do not have hyphens will be linked separately, as above. Any hyphen-separated components may be linked in one of three ways:
 * If 1 is specified or the hyphen-separated component exists as an English term when the hyphens are converted to spaces, it will be linked to that term. For example, will be linked as   because  exists as an English term. (In this case,  also exists but is approximately a soft redirect to, as is often the case with such attributive compounds. This is why we prefer the space-separated variant.)
 * If 1 is specified or the hyphen-separated component exists as an English term in its unmodified form but not when the hyphens are converted to spaces, it will be linked as an unmodified whole. For example, will be linked as   because  exists as an English term but  does not. (An example that requires 1 is, where the default algorithm would incorrectly link the first component to . Here,  [a verb] and  [an adjective] both exist but refer to different things.)
 * If 1 is specified or the hyphen-separated component does not exist as an English term (either unmodified or when the hyphens are converted to spaces), each hyphenated component is linked separately. Examples where this happens are (linked as  ) and  linked as  ). Note that when separately linking hyphenated components, prefixes are recognized and handled specially, as documented below.

Special prefix handling
As described above, when splitting hyphenated components, if a component is not the last component and looks like one of the following prefixes, the following hyphen will be included inside of the link.



Suffix handling
If the term begins with a hyphen, it is assumed to be a suffix rather than a base form, and is categorized into Category:English suffixes and Category:English POS-forming suffixes rather than Category:English POSs (e.g. Category:English noun-forming suffixes rather than Category:English nouns). This can be overridden using 1. (An example where this is necessary is, which refers to a linguistic process of blending words with the suffix -ussy but is not itself a suffix.)

Link modifications
The default behavior described above under is sufficient in most circumstances, but some multiword terms need special linking behavior to handle things like inflected terms (e.g. those ending in  or ), capitalized terms, multiword subexpressions, etc. One way to handle that is to use head and spell out the entire headword, appropriately linked, effectively ignoring the default linking behavior. But this can be awkward for long multiword terms. For cases like this, a shortcut syntax is provided to apply link modifications on top of the autolinked term. To enable this, put a tilde at the beginning of the value specified to head, followed by the changes to individual words.

For example, for the term, we would like to link necrotising to. This can be done as follows: or more compactely as This is equivalent to writing en-noun, but shorter. In general, syntax of the form  is equivalent to writing , and says to replace   with   in the default output produced by the  mechanism described above.
 * en-noun
 * en-noun

The same syntax works on the beginning of a word, which is especially useful when linking to the lowercase equivalent of a capitalized term. For example, for, use the following to link Navy to : This is equivalent to writing en-noun but shorter.
 * en-noun

Modifications need to match full words, but can be applied to multiple words. A  on the right-hand side is a shortcut that stands for the left-hand side, which is especially useful when multiple words are given on the left-hand side, and causes the words to be linked together. For example, for, to link as a single entity, use the following: which is equivalent to en-noun. The right-hand side need not consist solely of a tilde, but can contain other surrounding text. For example, for, use the following to link to the Wikipedia entry for : This is equivalent to writing en-noun.
 * en-noun
 * en-noun

Multiple modifications can be specified, separated by a semicolon (optionally with surrounding spaces). For example, for, use: This is equivalent to writing en-noun.
 * en-noun