Модул:typing-aids/data/док

Ово је документациона подстраница за Модул:typing-aids/data

This module holds data indicating how to transform symbols/shortcuts into characters of the language in question. The data is used by Module:typing-aids and made available through {{chars}}. The return value of a module is a table holding replacements, in one of the following forms:

A list of replacements[уреди]

This format is preferred, because it clearly specifies the order in which the replacements will happen. Each replacement is itself a two-element list { "FROM", "TO", before = "BEFORE_CONDITION", after = "AFTER_CONDITION" }:

  • "FROM" is a Lua pattern indicating what to replace;
  • "TO" is a Lua replacement expression, which can include references to parenthesized groups in the pattern, e.g. %1 to refer to the first parenthesized group;
  • before = "BEFORE_CONDITION" is a Lua pattern, and the replacement will only happen if the specified pattern occurs before the symbol being replaced;
  • after = "AFTER_CONDITION" is a Lua pattern, and the replacement will only happen if the specified pattern occurs after the symbol being replaced.

Both before and after are optional.

The order in which the replacements happen is top-to-bottom.

A table of key-value pairs[уреди]

In this format, the key is a string (a Lua pattern indicating what to replace) and the value is either a string (a Lua replacement expression), or a table of the format { "REPLACEMENT", before = "BEFORE_CONDITION", after = "AFTER_CONDITION" }, where before and after are as above, and both are optional.

The order in which the replacements happen is undetermined; as a result, this format is dispreferred.

A list of tables of key-value pairs[уреди]

In this format, the return value consists of multiple key-value tables as in the second format above. All replacements in the first table happen before those in the second table, but the order in which the replacements happen in a given table is still undetermined; as a result, this format is also dispreferred.

Replacements for some languages are found in subpages: