Module:Wordify/doc

This module provides a number-formatting function. This function can be used from #invoke or from other Lua modules.

This module is used by FXConvert

Use from other Lua modules
To use the module from normal wiki pages, no special preparation is needed. If you are using the module from another Lua module, first you need to load it, like this:

&#x3c;syntaxhighlight lang="lua"&#x3e; local mf = require('Module:Wordify') &#x3c;/syntaxhighlight&#x3e;

(The &#x3c;code&#x3e;mf&#x3c;/code&#x3e; variable stands for Module wordiFy; you can choose something more descriptive if you prefer.)

Most functions in the module have a version for Lua and a version for #invoke. It is possible to use the #invoke functions from other Lua modules, but using the Lua functions has the advantage that you do not need to access a Lua frame object. Lua functions are preceded by &#x3c;code&#x3e;_&#x3c;/code&#x3e;, whereas #invoke functions are not.

main
&#x26;#123;{#invoke:Wordify|main|x|prec=|lk=|numsys=|lang=|script=|state=|case=|class=|possessed=|person=|plural=|exclude=|simplify=}}

&#x3c;syntaxhighlight lang="lua"&#x3e; mf._wordify(x, prec, lk, numsys, lang, script, state, case, class, possessed, person, plural, exclude, simplify) &#x3c;/syntaxhighlight&#x3e;

Simplify a number x using a word denoting an order of magnitude.


 * &#x3c;code&#x3e;numsys&#x3c;/code&#x3e; can be &#x3c;code&#x3e;short&#x3c;/code&#x3e; (short scale, the default), &#x3c;code&#x3e;ind &#x3c;/code&#x3e;(Indian scale), or &#x3c;code&#x3e;long&#x3c;/code&#x3e; (long scale)
 * &#x3c;code&#x3e;prec&#x3c;/code&#x3e; is the digits of precision to output
 * if &#x3c;code&#x3e;lk&#x3c;/code&#x3e; is true, the words will be linked to an explanation
 * &#x3c;code&#x3e;lang&#x3c;/code&#x3e; allows to specify the locale for formatting and wording
 * &#x3c;code&#x3e;script&#x3c;/code&#x3e; allows to specify a script if the language supports more than one
 * &#x3c;code&#x3e;state&#x3c;/code&#x3e; can be indefinite, definite, or construct
 * &#x3c;code&#x3e;case&#x3c;/code&#x3e; allows to specify a grammatical case
 * &#x3c;code&#x3e;class&#x3c;/code&#x3e; allows to specify a noun class
 * if &#x3c;code&#x3e;possessed&#x3c;/code&#x3e; is true, it designates that there are multiple possessed objects
 * &#x3c;code&#x3e;person&#x3c;/code&#x3e; designates the person (&#x3c;code&#x3e;1&#x3c;/code&#x3e;, &#x3c;code&#x3e;2&#x3c;/code&#x3e;, &#x3c;code&#x3e;3&#x3c;/code&#x3e;)
 * if &#x3c;code&#x3e;plural&#x3c;/code&#x3e; is true, it indicates that the person is plural
 * &#x3c;code&#x3e;exclude&#x3c;/code&#x3e; indicates the persons to exclude (&#x3c;code&#x3e;2&#x3c;/code&#x3e;, &#x3c;code&#x3e;3&#x3c;/code&#x3e;)
 * if &#x3c;code&#x3e;simplify&#x3c;/code&#x3e; is true, only the order of magnitude words will be output

Scales, links, scripts, capitalization

 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.

State, case

 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.

Simplification

 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.


 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.

Noun class agreement

 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.

Slavic numerals

 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.


 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.

Possessive cases

 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.

Possessive forms

 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.
 * &#x3c;code&#x3e;&#x3c;nowiki&#x3e;&#x3c;/nowiki&#x3e;&#x3c;/code&#x3e; displays.

Support for additional languages
New languages can be added by creating a corresponding object.

The &#x3c;code&#x3e;possessive&#x3c;/code&#x3e; field conforms to the following grammar:

&#x3c;syntaxhighlight lang="bnf"&#x3e; &#x3c;possessive-rules&#x3e; ::= "{}" | &#x3c;string&#x3e; | "{" &#x3c;possessor-cases&#x3e; "}" | &#x3c;possessive-function&#x3e; &#x3c;possessor-cases&#x3e; ::= &#x3c;singular-possessors&#x3e; | &#x3c;singular-posessors&#x3e; "," &#x3c;plural-posessors&#x3e; &#x3c;singular-possessors&#x3e; ::= "{" &#x3c;singular-possessor-cases&#x3e; "}" &#x3c;singular-posessor-cases&#x3e; := &#x3c;simple-posessor-case&#x3e; | &#x3c;simple-possessor-case&#x3e; "," &#x3c;singular-possessor-cases&#x3e; &#x3c;simple-posessor-case&#x3e; := "{ {" &#x3c;singular-possessed&#x3e; "," &#x3c;plural-possessed&#x3e; "} }" | &#x3c;possessor-function&#x3e; &#x3c;singular-possessed&#x3e; ::= &#x3c;possessed&#x3e; &#x3c;plural-possessed&#x3e; ::= &#x3c;possessed&#x3e; &#x3c;possessed&#x3e; ::= &#x3c;string&#x3e; | "{" &#x3c;possessed-cases&#x3e; "}" | &#x3c;possessed-function&#x3e; &#x3c;plural-posessors&#x3e; ::= "{" &#x3c;plural-possessor-cases&#x3e; "}" &#x3c;plural-possessor-cases&#x3e; := &#x3c;plural-posessor-case&#x3e; | &#x3c;plural-possessor-case&#x3e; "," &#x3c;plural-possessor-cases&#x3e; &#x3c;plural-possessor-case&#x3e; ::= "{" &#x3c;clusivity-cases&#x3e; "}" &#x3c;clusivity-cases&#x3e; ::= &#x3c;simple-possessor-case&#x3e; | &#x3c;simple-possessor-case&#x3e; "," &#x3c;clusivity-cases&#x3e; &#x3c;/syntaxhighlight&#x3e;

The &#x3c;code&#x3e;inflection&#x3c;/code&#x3e; field conforms to the following grammar:

&#x3c;syntaxhighlight lang="bnf"&#x3e; &#x3c;inflection-rules&#x3e; ::= "{}" | "{" &#x3c;stem-statement&#x3e; "}" | "{" &#x3c;number-cases&#x3e; "}" | "{" &#x3c;stem-statement&#x3e; "," &#x3c;number-cases&#x3e; "}" &#x3c;stem-statement&#x3e; ::= "stem" "=" &#x3c;stem-function&#x3e; &#x3c;number-cases&#x3e; ::= &#x3c;number-case&#x3e; | &#x3c;number-case&#x3e; "," &#x3c;number-cases&#x3e; &#x3c;number-case&#x3e; ::= &#x3c;number-index&#x3e; &#x3c;number-rule&#x3e; &#x3c;number-index&#x3e; ::= "" | "[" &#x3c;integer&#x3e; "]" "=" | | "[" "fraction" "]"  "=" &#x3c;number-rule&#x3e; ::= &#x3c;string&#x3e; | &#x3c;ending-cases-list&#x3e; | &#x3c;state-cases&#x3e; | &#x3c;number-function&#x3e; &#x3c;ending-cases-list&#x3e; ::= "{" &#x3c;ending-cases&#x3e; "}" &#x3c;ending-cases&#x3e; ::= &#x3c;ending-case&#x3e; | &#x3c;ending-case&#x3e; "," &#x3c;ending-cases&#x3e; &#x3c;ending-case&#x3e; ::= &#x3c;string-index&#x3e; "=" &#x3c;ending-rule&#x3e; &#x3c;ending-rule&#x3e; ::= &#x3c;string&#x3e; | &#x3c;class-cases-list&#x3e; | &#x3c;state-cases&#x3e; | &#x3c;ending-function&#x3e; &#x3c;class-cases-list&#x3e; ::= "{" &#x3c;class-cases&#x3e; "}" &#x3c;class-cases&#x3e; ::= &#x3c;class-case&#x3e; | &#x3c;class-case&#x3e; "," &#x3c;class-cases&#x3e; &#x3c;class-case&#x3e; ::= &#x3c;string-index&#x3e; "=" &#x3c;class-rule&#x3e; &#x3c;class-rule&#x3e; ::= &#x3c;string&#x3e; | &#x3c;grammatical-cases-list&#x3e; | &#x3c;state-cases&#x3e; | &#x3c;class-function&#x3e; &#x3c;state-cases&#x3e; ::= "{" &#x3c;indefinite-rule&#x3e; "}" | "{" &#x3c;indefinite-rule&#x3e; "," &#x3c;definite-rule&#x3e; "}" | "{" &#x3c;indefinite-rule&#x3e; "," &#x3c;definite-rule&#x3e; "," &#x3c;construct-rule&#x3e; "}" &#x3c;indefinite-rule&#x3e; ::= &#x3c;state-rule&#x3e; &#x3c;definite-rule&#x3e; ::= &#x3c;state-rule&#x3e; &#x3c;construct-rule&#x3e; ::= &#x3c;state-rule&#x3e; &#x3c;state-rule&#x3e; ::= &#x3c;string&#x3e; | &#x3c;grammatical-cases-list&#x3e; | &#x3c;state-function&#x3e; &#x3c;grammatical-cases-list&#x3e; ::= "{" &#x3c;grammatical-cases&#x3e; "}" &#x3c;grammatical-cases&#x3e; ::= &#x3c;grammatical-case&#x3e; | &#x3c;grammatical-case&#x3e; "," &#x3c;grammatical-cases&#x3e; &#x3c;grammatical-case&#x3e; ::= &#x3c;string-index&#x3e; "=" &#x3c;grammatical-rule&#x3e; &#x3c;grammatical-rule&#x3e; ::= &#x3c;string&#x3e; | &#x3c;simple-class-cases-list&#x3e; | "{" &#x3c;possessed-cases&#x3e; "}" | &#x3c;grammatical-function&#x3e; &#x3c;simple-class-cases-list&#x3e; ::= "{" &#x3c;simple-class-cases&#x3e; "}" &#x3c;simple-class-cases&#x3e; ::= &#x3c;simple-class-case&#x3e; | &#x3c;simple-class-case&#x3e; "," &#x3c;simple-class-cases&#x3e; &#x3c;simple-class-case&#x3e; ::= &#x3c;string-index&#x3e; "=" &#x3c;simple-class-rule&#x3e; &#x3c;simple-class-rule&#x3e; ::= &#x3c;string&#x3e; | &#x3c;simple-ending-cases-list&#x3e; | &#x3c;class-function&#x3e; &#x3c;simple-ending-cases-list&#x3e; ::= "{" &#x3c;simple-ending-cases&#x3e; "}" &#x3c;simple-ending-cases&#x3e; ::= &#x3c;simple-ending-case&#x3e; | &#x3c;simple-ending-case&#x3e; "," &#x3c;simple-ending-cases&#x3e; &#x3c;simple-ending-case&#x3e; ::= &#x3c;string-index&#x3e; "=" &#x3c;simple-ending-rule&#x3e; &#x3c;simple-ending-rule&#x3e; ::= &#x3c;string&#x3e; | &#x3c;ending-function&#x3e; &#x3c;/syntaxhighlight&#x3e;

Common elements:

&#x3c;syntaxhighlight lang="bnf"&#x3e; &#x3c;possessed-cases&#x3e; ::= &#x3c;possessed-case&#x3e; | &#x3c;possessed-case&#x3e; "," &#x3c;possessed-cases&#x3e; &#x3c;possessed-case&#x3e; ::= &#x3c;string-index&#x3e; "=" &#x3c;possessed-rule&#x3e; &#x3c;string-index&#x3e; ::= &#x3c;identifier&#x3e; | "[" &#x3c;string&#x3e; "]" &#x3c;possessed-rule&#x3e; ::= &#x3c;string&#x3e; | &#x3c;possessed-function&#x3e; &#x3c;/syntaxhighlight&#x3e;

The elements &#x3c;identifier&#x3e;, &#x3c;string&#x3e;, and &#x3c;integer&#x3e; are as defined for the Lua language and those ending in &#x3c;code&#x3e;-function&#x3c;/code&#x3e; are Lua functions with signatures that can be found in the code.

A certain language might not be supported by the current algorithm, in this case it should be extended for the new kind.