Module:ca-headword/documentation

From Wiktionary, the free dictionary
Jump to navigation Jump to search
Documentation for Module:ca-headword. [edit]
This page contains usage information, categories, interwiki links and other content describing the module.

This module is used for Catalan headword-line templates. This module currently implements {{ca-noun}}, {{ca-verb}}, {{ca-adj}}, {{ca-adv}}, {{ca-pp}} and several others; see the documentation of those templates for more information.

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, adverbs and past participles respectively):

{{#invoke:ca-headword|show|nouns}}
{{#invoke:ca-headword|show|adverbs}}
{{#invoke:ca-headword|show|past participles}}

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

|head=
Override the headword display, used to add links to individual words in a multiword term.
|nolinkhead=1
Don't link individual words in the headword of a multiword term. Useful for foreign terms like enfant terrible and sex symbol where the expression functions as a whole in Catalan but the individual parts are not Catalan words.
|splithyph=1
Indicate that automatic splitting and linking of words should split on hyphens in multiword expressions with spaces in them (splitting on hyphens is automatic if there are no spaces in the term). See #Autosplitting below for more information.
|pagename=
Override the page name used to compute default values of various sorts. Useful when testing, for documentation pages, etc.

There is no parameter for the sort key, because this is not necessary. The sort key is automatically generated according to the normal alphabetical ordering in Catalan.

Autosplitting[edit]

All templates using this module use an intelligent autosplitting algorithm to link portions of multipart and multiword expressions, as follows:

  • The module will automatically split and link distinct space-separated words, similarly to {{head}}; hence, tot i així will be linked as [[tot]] [[i]] [[així]].
  • It also splits on apostrophes in the middle of words and includes the apostrophe in the preceding portion. Hence, a cau d'orella (whispering) will be linked as [[a]] [[cau]] [[d']][[orella]].
  • In addition, parts of hyphenated compounds in single-word expressions will be linked individually, e.g. boca-orella (word of mouth) will be linked as [[boca]]-[[orella]]. Hyphenated compound words will not be split if they occur in multiword expressions unless |splithyph=1 is specified, since the compound itself might be a valid word. An example where |splithyph=1 should be used is a corre-cuita (in a hurry); when used with this parameter, it will be split as [[a]] [[corre]]-[[cuita]]

Suffix handling[edit]

If the term begins with a hyphen (-), it is assumed to be a suffix rather than a base form, and is categorized into Category:Catalan suffixes and Category:Catalan POS-forming suffixes rather than Category:Catalan POSs (e.g. Category:Catalan noun-forming suffixes rather than Category:Catalan nouns).