Template:affix/documentation

This template shows the parts (morphemes) that make up a word, for use in etymology sections. Although it is called affix, it can be used for compounds too, like. It uses Module:affix and Module:affix/templates as a back-end.

To create the category pages, such as Category:English terms suffixed with -ed, add to the page.

Examples
Basic examples:

In foreign languages:

1. For, which can be viewed as being composed of , an interfix and an augmentative suffix , use the following:
 * pt

which generates

This can equivalently be written using separate parameters (the older way of doing things) like this:

2. The Portuguese medical term can be viewed as being composed directly from  using the Portuguese privative (i.e. expressing "lack of") suffix  and the abstract noun suffix. Write this as follows:
 * pt

which generates

In this case, there are multiple Portuguese prefixes spelled, with different origins and meanings. To identify the privative prefix specifically, we use the  modifier (see senseid).

3. The Italian relational adjective was constructed directly from the  based on its stem lītor- (as found for example in the genitive singular ). Write this as follows:

which generates

The use of the bracketed expression allows us to display the accusative singular form while linking to the lemma form (the nominative singular). This could also be implemented using the  modifier.

4. The Portuguese toponym is composed of two words, literally meaning "New Scotland". This can be written as follows:

which generates

Here, we use the  ("part of speech") modifier to display the grammatical derivation of the word. This example shows that arbitrary template code can be embedded inside an inline modifier.

5. For the Japanese term, the following is an actual etymology:

This generates
 * Appears to be.

The use of the  modifier with an empty term serves to prevent the term from being linked. The sort parameter is needed in general with any Japanese templates that generate categories, because the sort key for this language cannot be automatically generated. (It is based on the pronunciation of the term, and many Japanese terms have multiple pronunciations.)

Parameters

 * 1
 * The language code. See Languages.


 * 2, 3 etc.
 * The parts of the terms to show. Either:
 * At least one of the provided parts must begin and/or end with a hyphen (prefix, suffix, interfix);
 * or there must be two or more parts (it may be a compound, with or without prefixes, suffixes, interfixes).
 * A term can begin with a language code followed by a colon. This overrides the default provided by 1. When this is provided, the language name is displayed before the part, and a derivational category is also added to the entry. This is used for the occasional term which was directly affixed at the time of borrowing, and for which no native base form existed at the time, such as.


 * pos
 * The part of speech to include in the category names, in plural form. Defaults to . This is separate from (and conceptually very different from) the pos N parameters, which specify clarifying parts of speech or similar descriptive text to display in parentheses after individual terms, next to the gloss.


 * lit
 * The literal meaning of the overall term. This is separate from the lit N parameters, which specify literal meanings of individual parts.


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


 * sc
 * The script code. See Scripts. This is rarely needed as the script can generally be automatically detected. This is separate from the sc N parameters, which specify script codes for individual parts in languages distinct from the overall language specified using 1.


 * 1
 * Do not add categories to the entry.


 * type
 * Type of compound, e.g. bahuvrihi or alliterative. See below. If this parameter is given, extra text is generated before the listed parts (e.g.  compound of FOO + BAR), and the page is placed in an additional category (e.g. Category:Hindi bahuvrihi compounds).


 * 1
 * Do not capitalize the first letter of the extra text generated by type.


 * 1
 * When type is used, do not generate the extra text that is normally placed before the listed parts. The page will still be placed in the additional type-specific category unless 1 is given.

The following parameters are available for each matching part in the numbered/positional parameters. The  must be replaced by the corresponding part index. For example, for the second part (positional parameter 3), use 2 for. Most of these parameters correspond directly to the equivalent parameters in the standard (and ) template.
 * alt N
 * The alternative display form. Equivalent to the third parameter of.


 * t N
 * A gloss to show after the part. Equivalent to the fourth parameter of . The parameter gloss N is deprecated for this purpose.


 * tr N
 * The transliteration, as in.


 * ts N
 * The transcription, in languages where the transliteration and transcription differ markedly, as in.


 * g N
 * The gender (multiple comma-separated genders may be specified for a given part).


 * id N
 * The sense id, as in . As distinguished by mere linking templates, the affix template, categorizing terms by affix, also adds the sense id to the category name to distinguish various purposes of the same affix shape, hence the sense id in the dictionary entry for the affix should have a reasonable name in respect to this categorization. Changes the category name from  to.


 * pos N
 * The part of speech label to show after the part, as in . If this parameter contains, the entry will be added to a language's patronymic category. If this parameter contains   and the pos parameter is defined, the entry will be added to a diminutive part-of-speech category. For instance, the parameter values noun and diminutive suffix will add an entry to the language's diminutive nouns category.


 * lit N
 * The literal meaning to show after the part, as in.


 * q N
 * Qualifier text to display before the part, in parens and normally italicized.


 * qq N
 * Qualifier text to display after the part, in parens and normally italicized.


 * lang N
 * The language code to use for this particular part. This overrides the default provided by 1. When this is provided, the language name is displayed before the part, and a derivational category is also added to the entry. This is used for the occasional term which was directly affixed at the time of borrowing, and for which no native base form existed at the time, such as.


 * sc N
 * The script code to use for this particular part. This overrides the default provided by sc.

Inline modifiers
All of the per-term parameters described above can alternatively be specified as inline modifiers, using a syntax like  to specify modifiers such as transliterations, glosses and qualifiers. In this example, for the Russian term, the manual transliteration dɛtɛktív and gloss "detective" are given. Specifically, the following modifiers are recognized; see the above documentation for more information on the exact meaning of each modifier.
 * or : gloss
 * : alternative display text
 * : transliteration
 * : transcription, for languages where the transliteration and pronunciation are markedly different
 * : qualifier, e.g. rare; this appears before the term, parenthesized and italicized
 * : qualifier, e.g. rare; this appears after the term, parenthesized and italicized
 * : literal meaning
 * : part of speech
 * : comma-separated list of gender/number specifications
 * : sense ID; see
 * : language code
 * : script code

Examples
The following: From. can be equivalently written as follows using inline modifiers: From. Both produce the following:

From.

Note how the use of inline modifiers frees you from having to make sure the numbers of indexed parameters like t1, pos2 correctly line up with the terms they are referring to.

Categories
The template will automatically categorize the entry based on the types of affixes it sees. This behavior can be disabled by prefixing an entry with. This should be used, for example, for Proto-Indo-European roots, which are conventionally written with a trailing hyphen but aren't prefixes.
 * If a part begins with a hyphen, it is a suffix.
 * If a part ends with a hyphen, it's a prefix.
 * If a part has a hyphen at both ends, it's an interfix.

What is considered a hyphen depends on the specified language, so it can also support language-specific types of hyphen. In particular, the Hebrew and Arabic scripts have their own hyphen script-specific character (which has the correct right-to-left behavior).

Some languages (e.g. most East Asian languages) don't use hyphens with affixes. For these languages, you should still add a regular hyphen to the affix as appropriate, but the term will be displayed and linked without a hyphen.

Compound subtypes
The type parameter can be used to specify the subtype of compound when is used to specify the parts of a compound. For example, if bahuvrihi is given (or bahu or bv), extra text  compound of is generated before the listed parts (where the word bahuvrīhi links appropriately to the appendix, with an explanation of what this term means). In addition, the page is placed in a type-specific category, e.g. Category:Hindi bahuvrihi compounds if the language in question is Hindi (code ).

The parameter 1 can be used to disable capitalization of the first letter of the extra text generated, and 1 can be used to suppress the extra text entirely. Using type along with notext is still useful because of the extra type-specific category that the page is placed in. It's also possible to use type without any parts, e.g. . This generates just the extra text (without the word of after it), and places the page in the type-specific category.

The following types are currently supported:

Limitations

 * There is no support for circumfixes.
 * If an entry both begins and ends with a hyphen, it is considered an interfix, not an infix. There is currently no support for infixes as such.

Template Data
{	"params": { "1": {			"label": "language code", "type": "string", "required": true, "aliases": [ "lang" ],			"description": "the 2- or 3-letter language code for the current section", "example": "en" },		"2": {			"label": "first part", "type": "wiki-page-name", "suggested": true, "description": "the first part of the affixed word", "example": "neuro" },		"3": {			"label": "second part", "type": "wiki-page-name", "suggested": true, "description": "the second part of the affixed word", "example": "genic" },		"sc": { "label": "script code", "type": "string" },		"pos1": { "label": "first part of speech", "type": "string" },		"pos2": { "label": "second part of speech", "type": "string" },		"alt1": { "label": "first part alternate text", "type": "string", "description": "Text to show instead of the first part for the link to its entry" },		"alt2": { "label": "second part alternate text", "type": "string", "description": "Text to show instead of the second part for the link to its entry" },		"t1": { "label": "first gloss", "type": "string", "description": "brief gloss of the first part" },		"t2": { "label": "second gloss", "type": "string", "description": "brief gloss of the second part" },		"tr1": { "label": "first part transliteration", "type": "string", "description": "Transliteration of the first part (for non-Latin scripts)" },		"tr2": { "label": "second part transliteration", "type": "string", "description": "Transliteration of the second part (for non-Latin scripts)" }	},	"format": "inline" }