Wiktionary:Context labels: difference between revisions

From Wiktionary, the free dictionary
Jump to navigation Jump to search
Content deleted Content added
Mglovesfun (talk | contribs)
<code> not <tt>, definition clearer than 'sense'
Line 1: Line 1:
{{shortcut|WT:CL}}
{{shortcut|WT:CL}}


Use {{temp|context}} or any of the [[:Category:Context labels|context templates]] to indicate grammatical or restricted-usage information about senses, as described in [[Wiktionary:Entry layout explained#Context labels|Entry Layout Explained]]. Context labels may indicate:
Use {{temp|context}} or any of the [[:Category:Context labels|context templates]] to indicate grammatical or restricted-usage information about definitions, as described in [[Wiktionary:Entry layout explained#Context labels|Entry Layout Explained]]. Context labels may indicate:


Grammatical information about a sens
Grammatical information about a definition:


* A certain grammatical function or property (for example, ''[[Appendix:Glossary#auxiliary|auxiliary]], [[Appendix:Glossary#uncountable|uncountable]], plural only, passive'')
* A certain grammatical function or property (for example, ''[[Appendix:Glossary#auxiliary|auxiliary]], [[Appendix:Glossary#uncountable|uncountable]], plural only, passive'')


Restricted usage of a sens
Restricted usage of a definitions:


* Within a geographic or dialectal region (''Australian, Flemish, Northumbrian'')
* Within a geographic or dialectal region (''Australian, Flemish, Northumbrian'')
Line 16: Line 16:
The context is placed before the definition, such as:
The context is placed before the definition, such as:


<tt><nowiki># {{context|AU|slang|lang=en}} An [[insidious]] person.</nowiki></tt>
<code><nowiki># {{context|Australia|slang|lang=en}} An [[insidious]] person.</nowiki></code>


# {{context|Australian|slang|lang=en}} An [[insidious]] person.
# {{context|Australia|slang|lang=en}} An [[insidious]] person.


Use of a context label can provide automatic categorization. For instance, the example above is categorized as [[:Category:Australian English]] and [[:Category:English slang]]. Likewise, any page with a context of ''math'' or ''maths'' will be automatically placed in category [[:Category:en:Mathematics]]. However, these templates should not be used merely for categorization. It is still preferable to list a <tt><nowiki>[[Category: ]]</nowiki></tt> when there is no specific context for a term.
Use of a context label can provide automatic categorization. For instance, the example above is categorized as [[:Category:Australian English]] and [[:Category:English slang]]. Likewise, any page with a context of ''math'' or ''maths'' will be automatically placed in category [[:Category:en:Mathematics]]. However, these templates should not be used merely for categorization. It is still preferable to list a <code><nowiki>[[Category: ]]</nowiki></code> when there is no specific context for a term.


Regions are meant to indicate where a term is used, not to specify location of an entity. For instance, the [[Sphinx]] in Giza should not be labeled ''Egypt''. Rather, that's part of the definition. Also note that ''time'' and ''space'' are not contexts. The word “[[week]]” is understood to mean seven days whether one is discussing war or widgets or the weather, in speech or song or storybook.
Regions are meant to indicate where a term is used, not to specify location of an entity. For instance, the [[Sphinx]] in Giza should not be labeled ''Egypt''. Rather, that's part of the definition. Also note that ''time'' and ''space'' are not contexts. The word “[[week]]” is understood to mean seven days whether one is discussing war or widgets or the weather, in speech or song or storybook.
Line 26: Line 26:
== Use in dictionary entries ==
== Use in dictionary entries ==


Use <tt>{<nowiki/>{context}}</tt> before definitions, with one or more contextual labels. (Elsewhere, use {{temp|sense}} or {{temp|qualifier}} instead.) Currently, up to nine parameters can be listed, as well as a <tt>lang</tt> parameter to specify language. For instance, the following will categorize ''[[gringo]]'' in [[:Category:Spanish pejoratives]]:
Use <code>{<nowiki/>{context}}</code> before definitions, with one or more contextual labels. (Elsewhere, use {{temp|sense}} or {{temp|qualifier}} instead.) Currently, up to nine parameters can be listed, as well as a <code>lang</code> parameter to specify language. For instance, the following will categorize ''[[gringo]]'' in [[:Category:Spanish pejoratives]]:


<tt><nowiki># {{context|pejorative|lang=es}} An [[American]].</nowiki></tt>
<code><nowiki># {{context|pejorative|lang=es}} An [[American]].</nowiki></code>


# {{context|pejorative|lang=es}} An [[American]].
# {{context|pejorative|lang=es}} An [[American]].
Line 34: Line 34:
If a label is recognized, it may be automatically substituted with a standard label, and the page may be automatically categorized. If a label is not recognized, the text will be shown regardless. For instance, the following code on ''[[blue moon]]'' will still work, even though there is no "by extension" template (actually, now {{temp|by extension}} does exist):
If a label is recognized, it may be automatically substituted with a standard label, and the page may be automatically categorized. If a label is not recognized, the text will be shown regardless. For instance, the following code on ''[[blue moon]]'' will still work, even though there is no "by extension" template (actually, now {{temp|by extension}} does exist):


<tt><nowiki># {{context|by extension|lang=en}} A long time.</nowiki></tt>
<code><nowiki># {{context|by extension|lang=en}} A long time.</nowiki></code>


# {{context|by extension|lang=en}} A long time.
# {{context|by extension|lang=en}} A long time.
Line 40: Line 40:
There are also special key words ''and'' and ''or'', and the underscore (_) to indicate a space only, suppressing the comma. The result will list the separate contexts as possibilities, as within the entry ''[[in the year of our Lord]]'':
There are also special key words ''and'' and ''or'', and the underscore (_) to indicate a space only, suppressing the comma. The result will list the separate contexts as possibilities, as within the entry ''[[in the year of our Lord]]'':


<tt><nowiki># {{context|archaic|or|religious|lang=en}} [[anno domini|Anno domini]].</nowiki></tt>
<code><nowiki># {{context|archaic|or|religious|lang=en}} [[anno domini|Anno domini]].</nowiki></code>


# {{context|archaic|or|religious|lang=en}} [[anno domini|Anno domini]].
# {{context|archaic|or|religious|lang=en}} [[anno domini|Anno domini]].
Line 51: Line 51:
{{also|Appendix:Glossary}}
{{also|Appendix:Glossary}}


If the correct category can be located, the standard label name should be listed before other entries in that category. For instance, in [[:Category:Astronomy|Category:Astronomy]], [[Template:astronomy]] is listed at the top of the entries, indicating that <tt><nowiki>{{context|</nowiki></tt>''...''<tt>|astronomy|</tt>''...''<tt>}}</tt> will automatically categorize the entry. In some cases there may be more than one template. For instance, [[Template:constellation]] and [[Template:star]] are also listed in subcategories of [[:Category:Astronomy|Category:Astronomy]] as special cases.
If the correct category can be located, the standard label name should be listed before other entries in that category. For instance, in [[:Category:Astronomy|Category:Astronomy]], [[Template:astronomy]] is listed at the top of the entries, indicating that <code><nowiki>{{context|</nowiki></code>''...''<code>|astronomy|</code>''...''<code>}}</code> will automatically categorize the entry. In some cases there may be more than one template. For instance, [[Template:constellation]] and [[Template:star]] are also listed in subcategories of [[:Category:Astronomy|Category:Astronomy]] as special cases.


There is also a collection of standard [[:Category:Context labels|context labels]], an automatically generated category. The label <tt>mathematics</tt> is standard, and it's simple to check that it appears in that category. Non-standard label templates will redirect to the standard ones. For instance, [[Template:math]] and [[Template:maths]] are both redirects to [[Template:mathematics]]. Thus any of the labels ''math'', ''maths''{{,}} or ''mathematics'' can be used with <tt>context</tt> and will provide the same result.
There is also a collection of standard [[:Category:Context labels|context labels]], an automatically generated category. The label <code>mathematics</code> is standard, and it's simple to check that it appears in that category. Non-standard label templates will redirect to the standard ones. For instance, [[Template:math]] and [[Template:maths]] are both redirects to [[Template:mathematics]]. Thus any of the labels ''math'', ''maths''{{,}} or ''mathematics'' can be used with <code>context</code> and will provide the same result.


== Creating label templates ==
== Creating label templates ==


These examples should guide advanced users in the formation of new [[:Category:Context labels|contextual label templates]] in the <tt>Template:</tt> namespace. Make sure to create the label template at the same name as the label, using lowercase unless the word is always capitalized.
These examples should guide advanced users in the formation of new [[:Category:Context labels|contextual label templates]] in the <code>Template:</code> namespace. Make sure to create the label template at the same name as the label, using lowercase unless the word is always capitalized.


Each template contains:
Each template contains:

Revision as of 11:06, 22 June 2013

Use {{context}} or any of the context templates to indicate grammatical or restricted-usage information about definitions, as described in Entry Layout Explained. Context labels may indicate:

Grammatical information about a definition:

  • A certain grammatical function or property (for example, auxiliary, uncountable, plural only, passive)

Restricted usage of a definitions:

  • Within a geographic or dialectal region (Australian, Flemish, Northumbrian)
  • By technical or specialized subject field (banking, medicine, sports)
  • Some other context (archaic, historical, slang, vulgar, etc).
  • Some labels qualify the usage of other context labels (chiefly).

The context is placed before the definition, such as:

# {{context|Australia|slang|lang=en}} An [[insidious]] person.
  1. (deprecated template usage) (Australia, slang) An insidious person.

Use of a context label can provide automatic categorization. For instance, the example above is categorized as Category:Australian English and Category:English slang. Likewise, any page with a context of math or maths will be automatically placed in category Category:en:Mathematics. However, these templates should not be used merely for categorization. It is still preferable to list a [[Category: ]] when there is no specific context for a term.

Regions are meant to indicate where a term is used, not to specify location of an entity. For instance, the Sphinx in Giza should not be labeled Egypt. Rather, that's part of the definition. Also note that time and space are not contexts. The word “week” is understood to mean seven days whether one is discussing war or widgets or the weather, in speech or song or storybook.

Use in dictionary entries

Use {{context}} before definitions, with one or more contextual labels. (Elsewhere, use {{sense}} or {{qualifier}} instead.) Currently, up to nine parameters can be listed, as well as a lang parameter to specify language. For instance, the following will categorize gringo in Category:Spanish pejoratives:

# {{context|pejorative|lang=es}} An [[American]].
  1. (deprecated template usage) (derogatory) An American.

If a label is recognized, it may be automatically substituted with a standard label, and the page may be automatically categorized. If a label is not recognized, the text will be shown regardless. For instance, the following code on blue moon will still work, even though there is no "by extension" template (actually, now {{by extension}} does exist):

# {{context|by extension|lang=en}} A long time.
  1. (deprecated template usage) (by extension) A long time.

There are also special key words and and or, and the underscore (_) to indicate a space only, suppressing the comma. The result will list the separate contexts as possibilities, as within the entry in the year of our Lord:

# {{context|archaic|or|religious|lang=en}} [[anno domini|Anno domini]].
  1. (deprecated template usage) (archaic or religious) Anno domini.

The default comma (,) is understood to mean “and”.

To add a sort key to the automatically generated categories, use sort=. This will always be followed by {{PAGENAME}} so it can be just the prefix.

Finding context labels

If the correct category can be located, the standard label name should be listed before other entries in that category. For instance, in Category:Astronomy, Template:astronomy is listed at the top of the entries, indicating that {{context|...|astronomy|...}} will automatically categorize the entry. In some cases there may be more than one template. For instance, Template:constellation and Template:star are also listed in subcategories of Category:Astronomy as special cases.

There is also a collection of standard context labels, an automatically generated category. The label mathematics is standard, and it's simple to check that it appears in that category. Non-standard label templates will redirect to the standard ones. For instance, Template:math and Template:maths are both redirects to Template:mathematics. Thus any of the labels math, maths, or mathematics can be used with context and will provide the same result.

Creating label templates

These examples should guide advanced users in the formation of new contextual label templates in the Template: namespace. Make sure to create the label template at the same name as the label, using lowercase unless the word is always capitalized.

Each template contains:

{{context {{{sub|helper}}}|label=(label)|topcat=(topical category)|tcat=topical
|next={{{next|}}}|lang={{{lang|}}}|sort={{{sort|}}}}}

this generates a label, and places the entry in a topic category.

The label= parameter may be wikilinked, and may include an alternate.

The second line is all magic, and should be exactly as given when possible, to facilitate a 'bot modification if required in future.

POS or POS like categories

If the category is a POS type category, for example the idiomatic label template, use poscat=: poscat=idioms. (note in this case it should be lower case) If a language is specified, it will generate the category with the language name. If no category is desired, both topcat and poscat may be omitted. (There isn't a known case where both are required? It will work.)

{{context {{{sub|helper}}}|label=(label)|poscat=(PoS-like category)|tcat=grammatical
|next={{{next|}}}|lang={{{lang|}}}|sort={{{sort|}}}}}

Regional labels

A country or regional label for a dialect or variant is written

{{context {{{sub|helper}}}|label=(region name)|regcat=(region adjective)|tcat=regional
|next={{{next|}}}|lang={{{lang|}}}|sort={{{sort|}}}}}

Where (region name) is the proper name of the country or region (city, area, tribal/ethnic area, etc), (region adjective) is the adjectival form (e.g. for "Mexico", this is "Mexican", and (xx) is the default language to use. (Note that the lang parameter has to be defaulted as shown, the simpler form of parameter defaulting does not work with multiple labels.)

Modifiers

A modifier is a label template that adds _ as the next= parameter, instead of {{{next|}}}: ...|label=usually|next=_|... in Template:usually and does not use the category parameters.

Categorizing labels

Labels are placed into subcategories of Category:Context labels using tcat= and one of the category names Grammatical, Qualifier, Regional, Topical, or Usage.

  • Topical labels identify usage in a technical or specialized subject field: medicine, banking, etc.
  • Regional labels identify dialect or regionalism: Australian, Flemish, etc.
  • Grammatical context labels identify the part of speech or grammatical function of the sense: auxiliary, uncountable, etc.
  • Usage labels identify other contexts: archaic, historical, slang, vulgar, etc.
  • Qualifiers modify other context labels: chiefly, etc.

Customization

Readers can customize the display of definition context qualifiers. Your current style is this:

  1. (deprecated template usage) (context like this, your current style) a definition....

Some readers prefer custom styles:

  1. (context like this, non-italic) a definition....
  2. (context like this, mostly italic) a definition....
  3. (context like this, all italic) a definition....
  4. (context like this, non-italic) a definition....
  5. Context like this, small-caps and no parentheses a definition...
  6. (Context like this, small font) a definition

This template allows readers to choose such custom formats using WT:PREFS or by editing your personal CSS file (e.g. Special:Mypage/monobook.css), as described in WT:CUSTOM.