User:Robert Ullmann/Missing forms/control

Definition from Wiktionary, the free dictionary
Jump to: navigation, search

control table for missing forms hunt

In this table, the match string must be wrapped in nowiki tags. When read, the program maps {{ to \{\{, [[ to \[\[, and | to \|, so those escapes are not needed. (makes the table prettier ;-) The strings ([[|) and (]]|) are also escaped to work as expected. The match is to the template with the PAGENAME prepended, so if needed, it becomes \1), (.+) is prepended to match the pagename, so other groups captured start with \2.

This ruleset is ordered: once a rule matches the process will stop. Thus the rule for {{en-adj}} that matches two fully specifed forms need not be concerned with not matching {{en-adj|...|er}} which precedes it.

Each template in the wikitext has parameters sorted into a canonical order before match, so one doesn't have to create separate cases for different placement of named parameters. Positional parameters come first, then named parameters at the end. Also:

  • language codes are changed to the names
  • parameters in ignore are elided
  • a (positional) parameter that is a simple word wikilinked is unlinked
  • likewise if it has a section link or alt: [[x#y|z]] becomes x

I.e. {{plural of|lang=fr|[[chat]]}} becomes {{plural of|chat|lang=French}} and only the latter pattern need match.

Is fine to create multiple tables, say for languages, the software only cares about the individual lines and the overall order.

English[edit]

language template ignore match string replace string (list of forms) notes
English en-noun sg {{en-noun}} \1s regular -s plural
English en-noun sg {{en-noun|-}} uncountable
English en-noun sg {{en-noun|s}} \1s explicit -s plural
English en-noun sg {{en-noun|s|-}} \1s explicit -s plural, count/uncount
English en-noun sg {{en-noun|es}} \1es -es plural
English en-noun sg {{en-noun|es|-}} \1es -es plural, count/uncount
English en-noun sg {{en-noun|(\w+)}} \2 explicit/irregular
English en-noun sg {{en-noun|(\w+)|(\w+)}} \2\3 irregular with ending
English en-noun sg {{en-noun|pl=(\w+)|pl2=(\w+)}} \2 \3 pl and pl2
English en-noun sg pl2 {{en-noun|pl=(\w+)}} \2 pl and no pl2 or pl2 won't parse
English en-noun sg pl {{en-noun|pl2=(\w+)}} \2 pl2 and no pl or pl won't parse
English en-verb inf {{en-verb}} \1ed \1s \1ing default regular case
English en-verb inf {{en-verb|(\w+)|es}} \2ed \2es \ing -es present third
English en-verb inf {{en-verb|(\w+)|d}} \2d \2s \2ing -d past
English en-verb inf {{en-verb|(\w+)|ing}} \2ed \1s \2ing -ing stem change (and -ed)
English en-verb inf {{en-verb|(\w+)|(\w+)|es}} \2\3ed \2\3es \2\3ing -es with added letter
English en-verb inf {{en-verb|(\w+)|i|ed}} \2ied \2ies \1ing -ed with added letter i
English en-verb inf {{en-verb|(\w+)|(\w+)|ed}} \2\3ed \1s \2\3ing -ed with added letter
English en-verb inf {{en-verb|(\w+)|(\w+)|ing}} \2\3ed \1s \2\3ing -ing with added letter
English en-verb inf {{en-verb|(\w+)|(\w+)|(\w+)}} \2 \3 \4 explicit 3 forms
English en-verb inf {{en-verb|(\w+)|(\w+)|(\w+)|(\w+)}} \2 \3 \4 \5 explicit 4 forms
English en-adj pos {{en-adj}} nothing
English en-adj pos {{en-adj|-}} nothing
English en-adj pos {{en-adj|more}} same as no parameter, nothing
English en-adj pos {{en-adj|er}} \1er \1est default regular case
English en-adj pos {{en-adj|er|est}} \1er \1est default regular case (also works in template)
English en-adj pos {{en-adj|er|more}} \1er \1est regular case + more
English en-adj pos {{en-adj|(\w+)|er}} \2er \2est variant root -er
English en-adj pos {{en-adj|(\w+)|ier}} \2ier \2iest variant root -ier
English en-adj pos {{en-adj|(\w+)|r}} \2r \2st variant root -r
English en-adj pos {{en-adj|(\w+)|(\w+)}} \2 \3 irregular
English en-adj pos {{en-adj|(\w+)}} \2 irregular comparative, superlative uses most
English en-adv pos {{en-adv}} nothing
English en-adv pos {{en-adv|-}} absolute
English en-adv pos {{en-adv|er}} \1er \1est default regular case
English en-adv pos {{en-adv|er|more}} \1er \1est regular case + more
English en-adv pos {{en-adv|(\w+)|er}} \2er \2est variant root -er
English en-adv pos {{en-adv|(\w+)|ier}} \2ier \2iest variant root -ier
English en-adv pos {{en-adv|(\w+)|r}} \2r \2st variant root -r
English en-adv pos {{en-adv|(\w+)|(\w+)}} \2 \3 irregular
English plural of nodot nocap {{plural of|(\w+)}} \2
English comparative of POS nodot nocap {{comparative of|(\w+)}} \2
English superlative of POS nodot nocap {{superlative of|(\w+)}} \2

Finnish[edit]

language template ignore match string replace string (list of forms) notes
Finnish fi-form of {{fi-form of|(\w+)|.*}} \2 various forms
Finnish plural of nodot nocap {{plural of|(\w+)|lang=Finnish}} \2
Finnish comparative of nodot nocap {{comparative of|(\w+)|lang=Finnish}} \2
Finnish superlative of nodot nocap {{superlative of|(\w+)|lang=Finnish}} \2

Italian[edit]

language template ignore match string replace string (list of forms) notes
Italian it-noun {{it-noun|(\w+)|(\w+)|(\w+)|(\w+)}} \2\5 noun plural
Italian it-adj {{it-adj|(\w+)}} \2a \2i \2e -o regular: -a -i -e
Italian it-adj {{it-adj|(\w+)|(\w+)|(\w+)}} \2\4 e.g. -e: -i
Italian it-adj {{it-adj|(\w+)|(\w+)|(\w+)|(\w+)|(\w+)}} \2\4 \2\5 \2\6 explicit endings
Italian it-adjsup {{it-adjsup|(\w+)}} \2a \2i \2e -o regular: -a -i -e
Italian plural of nodot nocap {{plural of|(\w+)|lang=Italian}} \2

Spanish[edit]

language template ignore match string replace string (list of forms) notes
Spanish es-verb-form {{es-verb-form|(\w+)}} \2 infinitive
Spanish plural of {{plural of|(\w+)|lang=Spanish}} \2

plurals in some other languages[edit]

language template ignore match string replace string (list of forms) notes
Dutch plural of nocap nodot {{plural of|(\w+)|lang=Dutch}} \2
French plural of nocap nodot {{plural of|(\w+)|lang=French}} \2
German plural of nocap nodot {{plural of|(\w+)|lang=German}} \2
Romanian plural of nocap nodot {{plural of|(\w+)|lang=Romanian}} \2

other templates[edit]

Note that "*" for language means add a rule for each language already seen in this table, with the lang= parameter added to the match string.

language template ignore match string replace string (list of forms) notes
* comparative of POS nocap nodot {{comparative of|(\w+)}} \2
* superlative of POS nocap nodot {{superlative of|(\w+)}} \2