Modulens syfte är att generera wikitabellkod som ska användas som byggstenar i grammatiktabeller. Med hjälp av modulen kan grammatikmoduler skapa grammatiktabeller på ett mer läsbart och överskådligt sätt.
local gt = require("Modul:grammar-table") local lang_code = "sv" local part_of_speech = "adj" local number_of_columns = 3 local has_warning = "false" local str = gt.getStart(number_of_columns, lang_code, part_of_speech, has_warning) .. gt.getRow({"!", "Rubrik"}, "böjningsform") .. gt.getRow({"!", "Rubrik"}, "böjningsform") .. gt.getEnd(number_of_columns, "Kommentar", "förled")
!
, |
, |class="min"
, |rowspan="2"
, |class="min" colspan="3"
<span class="infl">]</span>
20 tests failed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
mut.getRow({"!", "rubrik", '|rowspan="2"'}, "form1", "form2", "form3") | |-
!|rubrik |rowspan="2"|<span class="infl">[]</span> ||<span class="infl">[]</span> ||<span class="infl">[]</span> || |- !|rubrik |rowspan="2"|<span data-grammar-link="infl">[]</span> ||<span data-grammar-link="infl">[]</span> ||<span data-grammar-link="infl">[]</span> | ||
mut.getRow({"|", "], ]", type="adv"}, "], ]") | |-
||<span class="adv">[]</span>, <span class="adv">[]</span> ||<span class="infl">[]</span>, <span class="infl">[]</span> || |- ||<span data-grammar-link="adv">[]</span>, <span data-grammar-link="adv">[]</span> ||<span data-grammar-link="infl">[]</span>, <span data-grammar-link="infl">[]</span> | ||
mut.getRow("form1, form2") | |-
||<span class="infl">[]</span>, <span class="infl">[]</span> || |- ||<span data-grammar-link="infl">[]</span>, <span data-grammar-link="infl">[]</span> |
Text | Expected | Actual | |
---|---|---|---|
mut.getRow("form1", "form2", "form3") | |-
||<span class="infl">[]</span> ||<span class="infl">[]</span> ||<span class="infl">[]</span> || |- ||<span data-grammar-link="infl">[]</span> ||<span data-grammar-link="infl">[]</span> ||<span data-grammar-link="infl">[]</span> |
Text | Expected | Actual | |
---|---|---|---|
mut.getRow({"!"}, {"|rowspan=2"}, {'|class="min"'}) | |-
!| |rowspan="2"| [[Kategori:Wiktionary:Sidor med tomma celler]] |class="min"| [[Kategori:Wiktionary:Sidor med tomma celler]] || |- !| |rowspan="2"| [[Kategori:Wiktionary:Sidor med tomma celler]] |class="min"| [[Kategori:Wiktionary:Sidor med tomma celler]] |
Text | Expected | Actual | |
---|---|---|---|
mut.getRow({"!", type="no-link"}, {'|rowspan="2"', type="no-link"}) | |-
!| |rowspan="2"| [[Kategori:Wiktionary:Sidor med tomma celler]] || |- !| |rowspan="2"| [[Kategori:Wiktionary:Sidor med tomma celler]] |
Text | Expected | Actual | |
---|---|---|---|
mut.getRow("], form2") | |-
||<span class="infl">[]</span>, <span class="infl">[]</span> || |- ||<span data-grammar-link="infl">[]</span>, <span data-grammar-link="infl">[]</span> | ||
mut.getRow("]<sup>1</sup>") | |-
||<span class="infl">[]</span><sup>1</sup> || |- ||<span data-grammar-link="infl">[]</span><sup>1</sup> | ||
mut.getRow("], vard. ]") | |-
||<span class="infl">[]</span>, vard. <span class="infl">[]</span> || |- ||<span data-grammar-link="infl">[]</span>, vard. <span data-grammar-link="infl">[]</span> | ||
mut.getRow("(])") | |-
||'''('''<span class="infl">[]</span>''')''' || |- ||'''('''<span data-grammar-link="infl">[]</span>''')''' | ||
mut.getRow("]") | |-
||<span class="infl">[[form1|fōrm1]]</span> || |- ||<span data-grammar-link="infl">[[form1|fōrm1]]</span> | ||
mut.getRow("<nowiki/>form1, form2") Med nowiki i modul |
|-
||<nowiki/>form1, <span class="infl">[]</span> || |- ||<nowiki/>form1, <span data-grammar-link="infl">[]</span> | ||
mut.getRow("<nowiki/>form1, form2") Med nowiki i mall |
|-
||"`UNIQ--nowiki-00000001-QINU`"'form1, <span class="infl">[]</span> || |- ||"`UNIQ--nowiki-00000001-QINU`"'form1, <span data-grammar-link="infl">[]</span> |
Text | Expected | Actual | |
---|---|---|---|
mut.getRow("ord1 ord2") | |-
||ord1 ord2 || |- ||ord1 ord2 |
Text | Expected | Actual | |
---|---|---|---|
mut.getRow(nil) | |- | |- | |
mut.getRow("") | |-
|| [[Kategori:Wiktionary:Sidor med tomma celler]] || |- || [[Kategori:Wiktionary:Sidor med tomma celler]] | ||
mut.getRow("-") | |-
||– || |- ||– | ||
mut.getRow("?") | |-
||? || |- ||? | ||
", type="no-link"})) | |-
|| [[Kategori:Wiktionary:Sidor med tomma celler]] || |- || [[Kategori:Wiktionary:Sidor med tomma celler]] | ||
", "", type="no-link"})) | |-
|| [[Kategori:Wiktionary:Sidor med tomma celler]] || |- || [[Kategori:Wiktionary:Sidor med tomma celler]] | ||
", "-", type="no-link"})) | |-
||– || |- ||– | ||
", "?", type="no-link"})) | |-
||? || |- ||? |
Text | Expected | Actual | |
---|---|---|---|
mut.getRow("e-post") | |-
||<span class="infl">[[e-post]]</span> || |- ||<span data-grammar-link="infl">[[e-post]]</span> | ||
mut.getRow("word's") | |-
||<span class="infl">[[word's]]</span> || |- ||<span data-grammar-link="infl">[[word's]]</span> | ||
mut.getRow("words'") | |-
||<span class="infl">[[words']]</span> || |- ||<span data-grammar-link="infl">[[words']]</span> | ||
mut.getRow("tv:n") | |-
||<span class="infl">[[tv:n]]</span> || |- ||<span data-grammar-link="infl">[[tv:n]]</span> | ||
mut.getRow("]") | |-
||<span class="infl">[[Övriga_uppslagsord#EU:s|EU:s]]</span> || |- ||<span data-grammar-link="infl">[[Övriga_uppslagsord#EU:s|EU:s]]</span> | ||
mut.getRow("'']''") | |-
||''<span class="infl">[]</span>'' || |- ||''<span data-grammar-link="infl">[]</span>'' |
Text | Expected | Actual | |
---|---|---|---|
mut.setLanguage("de") | (nil) | (nil) | |
mut.getRow({"!", "rubrik", '|rowspan="2"'}, "form1", "form2", "form3") | |-
!|rubrik |rowspan="2"|<span class="infl">[[form1#Tyska|form1]]</span> ||<span class="infl">[[form2#Tyska|form2]]</span> ||<span class="infl">[[form3#Tyska|form3]]</span> || |- !|rubrik |rowspan="2"|<span data-grammar-link="infl">[[form1#Tyska|form1]]</span> ||<span data-grammar-link="infl">[[form2#Tyska|form2]]</span> ||<span data-grammar-link="infl">[[form3#Tyska|form3]]</span> | ||
mut.getRow({"|", "], ]", type="adv"}, "], ]") | |-
||<span class="adv">[[form1#Tyska|form1]]</span>, <span class="adv">[[form2#Tyska|form2]]</span> ||<span class="infl">[[form3#Tyska|form3]]</span>, <span class="infl">[[form4#Tyska|form4]]</span> || |- ||<span data-grammar-link="adv">[[form1#Tyska|form1]]</span>, <span data-grammar-link="adv">[[form2#Tyska|form2]]</span> ||<span data-grammar-link="infl">[[form3#Tyska|form3]]</span>, <span data-grammar-link="infl">[[form4#Tyska|form4]]</span> | ||
mut.getRow("form1, form2") | |-
||<span class="infl">[[form1#Tyska|form1]]</span>, <span class="infl">[[form2#Tyska|form2]]</span> || |- ||<span data-grammar-link="infl">[[form1#Tyska|form1]]</span>, <span data-grammar-link="infl">[[form2#Tyska|form2]]</span> |