class InflTests(unittest.TestCase):
    def setUp(self):
        self.maxDiff = 100000
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def xinfl(self, word, lang, pos, section, text):
        """Runs a single inflection table parsing test, and returns ``data``."""
        self.ctx.start_page(word)
        self.ctx.start_section(lang)
        self.ctx.start_subsection(pos)
        tree = self.ctx.parse(text)
        data = {}
        parse_inflection_section(self.config, self.ctx, data, word, lang, pos,
                                 section, tree)
        return data

    def test_Latvian_verb1(self):
        ret = self.xinfl(
            "saprast", "Latvian", "verb", "Conjugation", """
<div class="NavFrame" style="width%3A470px">
<div class="NavHead" style>conjugation of ''saprast''</div>
<div class="NavContent">


{| border="1px+solid+%23000000" style="border-collapse%3Acollapse%3B+background%3A%23F9F9F9%3B+text-align%3Acenter%3B+width%3A100%25" class="inflection-table"

|-

! style="background%3A%23BCB2B0" |


! colspan="4" style="background%3A%23BCB2B0" | INDICATIVE <small>([[īstenības]] [[izteiksme]])</small>


! rowspan="2" style="background%3A%23BCB2B0" | IMPERATIVE<br><small>([[pavēles]] [[izteiksme]])</small>


|-

! style="background%3A%23BCB2B0" |


! style="background%3A%23BCB2B0" |


! style="background%3A%23BCB2B0" | Present<br><small>([[tagadne]])</small>


! style="background%3A%23BCB2B0" | Past<br><small>([[pagātne]])</small>


! style="background%3A%23BCB2B0" | Future<br><small>([[nākotne]])</small>


|-

! style="background%3A%23DEDEDE%3B+width%3A60px" | [[first person|1st pers.]] [[singular|sg.]]


! style="background%3A%23DEDEDE%3B+width%3A70px" | <span class="Latn" lang="lv">[[es#Latvian|es]]</span>


| <span class="Latn" lang="lv">[[saprotu#Latvian|saprotu]]</span>


| <span class="Latn" lang="lv">[[sapratu#Latvian|sapratu]]</span>


| <span class="Latn" lang="lv">[[sapratīšu#Latvian|sapratīšu]]</span>


| —


|-

! style="background%3A%23DEDEDE" | [[second person|2nd pers.]] [[singular|sg.]]


! style="background%3A%23DEDEDE" | <span class="Latn" lang="lv">[[tu#Latvian|tu]]</span>


| <span class="Latn" lang="lv">[[saproti#Latvian|saproti]]</span>


| <span class="Latn" lang="lv">[[saprati#Latvian|saprati]]</span>


| <span class="Latn" lang="lv">[[sapratīsi#Latvian|sapratīsi]]</span>


| <span class="Latn" lang="lv">[[saproti#Latvian|saproti]]</span>


|-

! style="background%3A%23DEDEDE" | [[third person|3rd pers.]] [[singular|sg.]]


! style="background%3A%23DEDEDE" | <span class="Latn" lang="lv">[[viņš#Latvian|viņš]]</span>, <span class="Latn" lang="lv">[[viņa#Latvian|viņa]]</span>


| <span class="Latn" lang="lv">[[saprot#Latvian|saprot]]</span>


| <span class="Latn" lang="lv">[[saprata#Latvian|saprata]]</span>


| <span class="Latn" lang="lv">[[sapratīs#Latvian|sapratīs]]</span>


| <span class="Latn" lang="lv">[[lai#Latvian|lai]]</span> <span class="Latn" lang="lv">[[saprot#Latvian|saprot]]</span>


|-

! style="background%3A%23DEDEDE" | [[first person|1st pers.]] [[plural|pl.]]


! style="background%3A%23DEDEDE" | <span class="Latn" lang="lv">[[mēs#Latvian|mēs]]</span>


| <span class="Latn" lang="lv">[[saprotam#Latvian|saprotam]]</span>


| <span class="Latn" lang="lv">[[sapratām#Latvian|sapratām]]</span>


| <span class="Latn" lang="lv">[[sapratīsim#Latvian|sapratīsim]]</span>


| <span class="Latn" lang="lv">[[sapratīsim#Latvian|sapratīsim]]</span>


|-

! style="background%3A%23DEDEDE" | [[second person|2nd pers.]] [[plural|pl.]]


! style="background%3A%23DEDEDE" | <span class="Latn" lang="lv">[[jūs#Latvian|jūs]]</span>


| <span class="Latn" lang="lv">[[saprotat#Latvian|saprotat]]</span>


| <span class="Latn" lang="lv">[[sapratāt#Latvian|sapratāt]]</span>


| <span class="Latn" lang="lv">[[sapratīsiet#Latvian|sapratīsiet]]</span>,<br><span class="Latn" lang="lv">[[sapratīsit#Latvian|sapratīsit]]</span>


| <span class="Latn" lang="lv">[[saprotiet#Latvian|saprotiet]]</span>


|-

! style="background%3A%23DEDEDE" | [[third person|3rd pers.]] [[plural|pl.]]


! style="background%3A%23DEDEDE" | <span class="Latn" lang="lv">[[viņi#Latvian|viņi]]</span>, <span class="Latn" lang="lv">[[viņas#Latvian|viņas]]</span>


| <span class="Latn" lang="lv">[[saprot#Latvian|saprot]]</span>


| <span class="Latn" lang="lv">[[saprata#Latvian|saprata]]</span>


| <span class="Latn" lang="lv">[[sapratīs#Latvian|sapratīs]]</span>


| <span class="Latn" lang="lv">[[lai#Latvian|lai]]</span> <span class="Latn" lang="lv">[[saprot#Latvian|saprot]]</span>


|-

! colspan="6" style="background%3A%23CDCDCD%3Bheight%3A.75em" |


|-

! colspan="3" style="background%3A%23DEDEDE" | RENARRATIVE <small>([[atstāstījuma]] [[izteiksme]])</small>


! colspan="3" style="background%3A%23DEDEDE" | PARTICIPLES <small>([[divdabji]])</small>


|-

! style="background%3A%23DEDEDE" | Present


| colspan="2" | <span class="Latn" lang="lv">[[saprotot#Latvian|saprotot]]</span>


! colspan="2" style="background%3A%23DEDEDE" | Present Active 1 <small>(Adj.)</small>


| <span class="Latn" lang="lv">[[saprotošs#Latvian|saprotošs]]</span>


|-

! style="background%3A%23DEDEDE" | Past


| colspan="2" | <span class="Latn" lang="lv">[[esot#Latvian|esot]]</span> <span class="Latn" lang="lv">[[sapratis#Latvian|sapratis]]</span>


! colspan="2" style="background%3A%23DEDEDE" | Present Active 2 <small>(Adv.)</small>


| <span class="Latn" lang="lv">[[saprazdams#Latvian|saprazdams]]</span>


|-

! style="background%3A%23DEDEDE" | Future


| colspan="2" | <span class="Latn" lang="lv">[[sapratīšot#Latvian|sapratīšot]]</span>


! colspan="2" style="background%3A%23DEDEDE" | Present Active 3 <small>(Adv.)</small>


| <span class="Latn" lang="lv">[[saprotot#Latvian|saprotot]]</span>


|-

! style="background%3A%23DEDEDE" | Imperative


| colspan="2" | <span class="Latn" lang="lv">[[lai#Latvian|lai]]</span> <span class="Latn" lang="lv">[[saprotot#Latvian|saprotot]]</span>


! colspan="2" style="background%3A%23DEDEDE" | Present Active 4 <small>(Obj.)</small>


| <span class="Latn" lang="lv">[[saprotam#Latvian|saprotam]]</span>


|-

! colspan="3" style="background%3A%23DEDEDE" | CONDITIONAL <small>([[vēlējuma]] [[izteiksme]])</small>


! colspan="2" style="background%3A%23DEDEDE" | Past Active


| <span class="Latn" lang="lv">[[sapratis#Latvian|sapratis]]</span>


|-

! style="background%3A%23DEDEDE" | Present


| colspan="2" | <span class="Latn" lang="lv">[[saprastu#Latvian|saprastu]]</span>


! colspan="2" style="background%3A%23DEDEDE" | Present Passive


| <span class="Latn" lang="lv">[[saprotams#Latvian|saprotams]]</span>


|-

! style="background%3A%23DEDEDE" | Past


| colspan="2" | <span class="Latn" lang="lv">[[būtu#Latvian|būtu]]</span> <span class="Latn" lang="lv">[[sapratis#Latvian|sapratis]]</span>


! colspan="2" style="background%3A%23DEDEDE" | Past Passive


| <span class="Latn" lang="lv">[[saprasts#Latvian|saprasts]]</span>


|-

! colspan="3" style="background%3A%23DEDEDE" | DEBITIVE <small>([[vajadzības]] [[izteiksme]])</small>


! colspan="3" style="background%3A%23DEDEDE" | NOMINAL FORMS


|-

! style="background%3A%23DEDEDE" | Indicative


| colspan="2" | (<span class="Latn" lang="lv">[[būt#Latvian|būt]]</span>) <span class="Latn" lang="lv">[[jāsaprot#Latvian|jāsaprot]]</span>


! colspan="2" style="background%3A%23DEDEDE" | Infinitive <small>(nenoteiksme)</small>


| <span class="Latn" lang="lv">[[saprast#Latvian|saprast]]</span>


|-

! style="background%3A%23DEDEDE" | Conjunctive&nbsp;1


| colspan="2" | <span class="Latn" lang="lv">[[esot#Latvian|esot]]</span> <span class="Latn" lang="lv">[[jāsaprot#Latvian|jāsaprot]]</span>


! colspan="2" style="background%3A%23DEDEDE" | Negative Infinitive


| <span class="Latn" lang="lv">[[nesaprast#Latvian|nesaprast]]</span>


|-

! style="background%3A%23DEDEDE" | Conjunctive&nbsp;2


| colspan="2" | <span class="Latn" lang="lv">[[jāsaprotot#Latvian|jāsaprotot]]</span>


! colspan="2" style="background%3A%23DEDEDE" | Verbal noun


| <span class="Latn" lang="lv">[[saprašana#Latvian|saprašana]]</span>


|}
</div></div>[[Category:Latvian first conjugation verbs]][[Category:Latvian first conjugation verbs in -t]][[Category:Latvian a/o/a-s/t type first conjugation verbs]][[Category:Latvian first conjugation verbs in -zt or -st]]
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form":
                "saprotu",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "present", "singular"]
            }, {
                "form":
                "sapratu",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "past", "singular"]
            }, {
                "form":
                "sapratīšu",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "indicative", "singular"]
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['first-person', 'imperative', 'singular']
            }, {
                "form":
                "saproti",
                "source":
                "Conjugation",
                "tags": ["indicative", "present", "second-person", "singular"]
            }, {
                "form":
                "saprati",
                "source":
                "Conjugation",
                "tags": ["indicative", "past", "second-person", "singular"]
            }, {
                "form":
                "sapratīsi",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "second-person", "singular"]
            }, {
                "form": "saproti",
                "source": "Conjugation",
                "tags": ["imperative", "second-person", "singular"]
            }, {
                "form":
                "saprot",
                "source":
                "Conjugation",
                "tags": ["indicative", "present", "singular", "third-person"]
            }, {
                "form":
                "saprata",
                "source":
                "Conjugation",
                "tags": ["indicative", "past", "singular", "third-person"]
            }, {
                "form":
                "sapratīs",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "singular", "third-person"]
            }, {
                "form": "lai saprot",
                "source": "Conjugation",
                "tags": ["imperative", "singular", "third-person"]
            }, {
                "form":
                "saprotam",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "plural", "present"]
            }, {
                "form": "sapratām",
                "source": "Conjugation",
                "tags": ["first-person", "indicative", "past", "plural"]
            }, {
                "form":
                "sapratīsim",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "indicative", "plural"]
            }, {
                "form": "sapratīsim",
                "source": "Conjugation",
                "tags": ["first-person", "imperative", "plural"]
            }, {
                "form":
                "saprotat",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "second-person"]
            }, {
                "form": "sapratāt",
                "source": "Conjugation",
                "tags": ["indicative", "past", "plural", "second-person"]
            }, {
                "form":
                "sapratīsiet",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "plural", "second-person"]
            }, {
                "form":
                "sapratīsit",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "plural", "second-person"]
            }, {
                "form": "saprotiet",
                "source": "Conjugation",
                "tags": ["imperative", "plural", "second-person"]
            }, {
                "form":
                "saprot",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "third-person"]
            }, {
                "form": "saprata",
                "source": "Conjugation",
                "tags": ["indicative", "past", "plural", "third-person"]
            }, {
                "form":
                "sapratīs",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "plural", "third-person"]
            }, {
                "form": "lai saprot",
                "source": "Conjugation",
                "tags": ["imperative", "plural", "third-person"]
            }, {
                "form": "saprotot",
                "source": "Conjugation",
                "tags": ["present", "renarrative"]
            }, {
                "form":
                "saprotošs",
                "source":
                "Conjugation",
                "tags": [
                    "active", "adjectival", "participle", "participle-1",
                    "present"
                ]
            }, {
                "form": "esot sapratis",
                "source": "Conjugation",
                "tags": ["past", "renarrative"]
            }, {
                "form":
                "saprazdams",
                "source":
                "Conjugation",
                "tags": [
                    "active", "adverbial", "participle", "participle-2",
                    "present"
                ]
            }, {
                "form": "sapratīšot",
                "source": "Conjugation",
                "tags": ["future", "renarrative"]
            }, {
                "form":
                "saprotot",
                "source":
                "Conjugation",
                "tags": [
                    "active", "adverbial", "participle", "participle-3",
                    "present"
                ]
            }, {
                "form": "lai saprotot",
                "source": "Conjugation",
                "tags": ["imperative"]
            }, {
                "form":
                "saprotam",
                "source":
                "Conjugation",
                "tags": ["active", "participle", "participle-4", "present"]
            }, {
                "form": "sapratis",
                "source": "Conjugation",
                "tags": ["active", "participle", "past"]
            }, {
                "form": "saprastu",
                "source": "Conjugation",
                "tags": ["conditional", "present"]
            }, {
                "form": "saprotams",
                "source": "Conjugation",
                "tags": ["participle", "passive", "present"]
            }, {
                "form": "būtu sapratis",
                "source": "Conjugation",
                "tags": ["conditional", "past"]
            }, {
                "form": "saprasts",
                "source": "Conjugation",
                "tags": ["participle", "passive", "past"]
            }, {
                "form": "jāsaprot",
                "source": "Conjugation",
                "tags": ["debitive", "indicative"]
            }, {
                "form": "būt jāsaprot",
                "source": "Conjugation",
                "tags": ["debitive", "indicative"]
            }, {
                "form": "saprast",
                "source": "Conjugation",
                "tags": ["infinitive"]
            }, {
                "form": "esot jāsaprot",
                "source": "Conjugation",
                "tags": ["conjunctive", "conjunctive-1", "debitive"]
            }, {
                "form": "nesaprast",
                "source": "Conjugation",
                "tags": ["infinitive", "negative"]
            }, {
                "form": "jāsaprotot",
                "source": "Conjugation",
                "tags": ["conjunctive", "conjunctive-2", "debitive"]
            }, {
                "form": "saprašana",
                "source": "Conjugation",
                "tags": ["noun-from-verb"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Latvian_noun1(self):
        ret = self.xinfl(
            "auss", "Latvian", "noun", "Declension", """
<div class="NavFrame" style="width%3A410px">
<div class="NavHead" style>Declension of ''auss''<nowiki /> (6th declension)</div>
<div class="NavContent">

{| border="1px+solid+%23000000" style="border-collapse%3Acollapse%3B+background%3A%23F9F9F9%3B+text-align%3Acenter%3B+width%3A100%25" class="inflection-table"

|-

! style="width%3A178px%3Bbackground%3A%23DEDEDE" |


! style="background%3A%23DEDEDE" | singular <small>([[vienskaitlis]])</small>


! style="background%3A%23DEDEDE" | plural <small>([[daudzskaitlis]])</small>


|-

! style="background%3A%23EFEFEF" | nominative <small>([[nominatīvs]])</small>


| <span class="Latn+form-of+lang-lv+nom%7Cs-form-of+++++++" lang="lv">[[auss#Latvian|auss]]</span>


| <span class="Latn+form-of+lang-lv+nom%7Cp-form-of+++++++" lang="lv">[[ausis#Latvian|ausis]]</span>


|-

! style="background%3A%23EFEFEF" | accusative <small>([[akuzatīvs]])</small>


| <span class="Latn+form-of+lang-lv+acc%7Cs-form-of+++++++" lang="lv">[[ausi#Latvian|ausi]]</span>


| <span class="Latn+form-of+lang-lv+acc%7Cp-form-of+++++++" lang="lv">[[ausis#Latvian|ausis]]</span>


|-

! style="background%3A%23EFEFEF" | genitive <small>([[ģenitīvs]])</small>


| <span class="Latn+form-of+lang-lv+gen%7Cs-form-of+++++++" lang="lv">[[auss#Latvian|auss]]</span>


| <span class="Latn+form-of+lang-lv+gen%7Cp-form-of+++++++" lang="lv">[[ausu#Latvian|ausu]]</span>


|-

! style="background%3A%23EFEFEF" | dative <small>([[datīvs]])</small>


| <span class="Latn+form-of+lang-lv+dat%7Cs-form-of+++++++" lang="lv">[[ausij#Latvian|ausij]]</span>


| <span class="Latn+form-of+lang-lv+dat%7Cp-form-of+++++++" lang="lv">[[ausīm#Latvian|ausīm]]</span>


|-

! style="background%3A%23EFEFEF" | instrumental <small>([[instrumentālis]])</small>


| <span class="Latn+form-of+lang-lv+ins%7Cs-form-of+++++++" lang="lv">[[ausi#Latvian|ausi]]</span>


| <span class="Latn+form-of+lang-lv+ins%7Cp-form-of+++++++" lang="lv">[[ausīm#Latvian|ausīm]]</span>


|-

! style="background%3A%23EFEFEF" | locative <small>([[lokatīvs]])</small>


| <span class="Latn+form-of+lang-lv+loc%7Cs-form-of+++++++" lang="lv">[[ausī#Latvian|ausī]]</span>


| <span class="Latn+form-of+lang-lv+loc%7Cp-form-of+++++++" lang="lv">[[ausīs#Latvian|ausīs]]</span>


|-

! style="background%3A%23EFEFEF" | vocative <small>([[vokatīvs]])</small>


| <span class="Latn+form-of+lang-lv+voc%7Cs-form-of+++++++" lang="lv">[[auss#Latvian|auss]]</span>


| <span class="Latn+form-of+lang-lv+voc%7Cp-form-of+++++++" lang="lv">[[ausis#Latvian|ausis]]</span>


|}
</div></div>[[Category:Latvian sixth declension&#32;&#32;nouns]][[Category:Latvian&#32;&#32;noun forms]][[Category:Latvian non-alternating sixth declension&#32;&#32;nouns]]
""")
        expected = {
            "forms": [{
                "form": "declension-6",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form": "6th declension",
                "source": "Declension",
                "tags": ["class"]
            }, {
                "form": "auss",
                "source": "Declension",
                "tags": ["nominative", "singular"]
            }, {
                "form": "ausis",
                "source": "Declension",
                "tags": ["nominative", "plural"]
            }, {
                "form": "ausi",
                "source": "Declension",
                "tags": ["accusative", "singular"]
            }, {
                "form": "ausis",
                "source": "Declension",
                "tags": ["accusative", "plural"]
            }, {
                "form": "auss",
                "source": "Declension",
                "tags": ["genitive", "singular"]
            }, {
                "form": "ausu",
                "source": "Declension",
                "tags": ["genitive", "plural"]
            }, {
                "form": "ausij",
                "source": "Declension",
                "tags": ["dative", "singular"]
            }, {
                "form": "ausīm",
                "source": "Declension",
                "tags": ["dative", "plural"]
            }, {
                "form": "ausi",
                "source": "Declension",
                "tags": ["instrumental", "singular"]
            }, {
                "form": "ausīm",
                "source": "Declension",
                "tags": ["instrumental", "plural"]
            }, {
                "form": "ausī",
                "source": "Declension",
                "tags": ["locative", "singular"]
            }, {
                "form": "ausīs",
                "source": "Declension",
                "tags": ["locative", "plural"]
            }, {
                "form": "auss",
                "source": "Declension",
                "tags": ["singular", "vocative"]
            }, {
                "form": "ausis",
                "source": "Declension",
                "tags": ["plural", "vocative"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Latvian_adj1(self):
        ret = self.xinfl(
            "zils", "Latvian", "adj", "Declension", """
<div class="NavFrame" style="width%3A508px">
<div class="NavHead" style>indefinite declension <small>([[nenoteiktā]] [[galotne]])</small> of ''zils''</div>
<div class="NavContent">


{| border="1" style="border-collapse%3Acollapse%3B+background%3A%23F9F9F9%3B+text-align%3Acenter%3B+width%3A100%25" class="inflection-table"

|-

! rowspan="2" style="background%3A%23DEDEDE%3Bwidth%3A195px" |


! colspan="2" style="background%3A%23DEDEDE%3Bwidth%3A156px" | masculine <small>([[vīriešu]] [[dzimte]])</small>


! rowspan="9" style="background%3A%23DEDEDE%3Bwidth%3A1px" |


! colspan="2" style="background%3A%23DEDEDE%3Bwidth%3A156px" | feminine <small>([[sieviešu]] [[dzimte]])</small>


|-

! style="background%3A%23DEDEDE%3Bwidth%3A77px" | singular <br><small>([[vienskaitlis]])</small>


! style="background%3A%23DEDEDE%3Bwidth%3A79px" | plural <br><small>([[daudzskaitlis]])</small>


! style="background%3A%23DEDEDE%3Bwidth%3A77px" | singular <br><small>([[vienskaitlis]])</small>


! style="background%3A%23DEDEDE%3Bwidth%3A79px" | plural <br><small>([[daudzskaitlis]])</small>


|-

! style="background%3A%23EFEFEF" | nominative <small>([[nominatīvs]])</small>


| <span class="Latn" lang="lv">[[zils#Latvian|zils]]</span>


| <span class="Latn" lang="lv">[[zili#Latvian|zili]]</span>


| <span class="Latn" lang="lv">[[zila#Latvian|zila]]</span>


| <span class="Latn" lang="lv">[[zilas#Latvian|zilas]]</span>


|-

! style="background%3A%23EFEFEF" | accusative <small>([[akuzatīvs]])</small>


| <span class="Latn" lang="lv">[[zilu#Latvian|zilu]]</span>


| <span class="Latn" lang="lv">[[zilus#Latvian|zilus]]</span>


| <span class="Latn" lang="lv">[[zilu#Latvian|zilu]]</span>


| <span class="Latn" lang="lv">[[zilas#Latvian|zilas]]</span>


|-

! style="background%3A%23EFEFEF" | genitive <small>([[ģenitīvs]])</small>


| <span class="Latn" lang="lv">[[zila#Latvian|zila]]</span>


| <span class="Latn" lang="lv">[[zilu#Latvian|zilu]]</span>


| <span class="Latn" lang="lv">[[zilas#Latvian|zilas]]</span>


| <span class="Latn" lang="lv">[[zilu#Latvian|zilu]]</span>


|-

! style="background%3A%23EFEFEF" | dative <small>([[datīvs]])</small>


| <span class="Latn" lang="lv">[[zilam#Latvian|zilam]]</span>


| <span class="Latn" lang="lv">[[ziliem#Latvian|ziliem]]</span>


| <span class="Latn" lang="lv">[[zilai#Latvian|zilai]]</span>


| <span class="Latn" lang="lv">[[zilām#Latvian|zilām]]</span>


|-

! style="background%3A%23EFEFEF" | instrumental <small>([[instrumentālis]])</small>


| <span class="Latn" lang="lv">[[zilu#Latvian|zilu]]</span>


| <span class="Latn" lang="lv">[[ziliem#Latvian|ziliem]]</span>


| <span class="Latn" lang="lv">[[zilu#Latvian|zilu]]</span>


| <span class="Latn" lang="lv">[[zilām#Latvian|zilām]]</span>


|-

! style="background%3A%23EFEFEF" | locative <small>([[lokatīvs]])</small>


| <span class="Latn" lang="lv">[[zilā#Latvian|zilā]]</span>


| <span class="Latn" lang="lv">[[zilos#Latvian|zilos]]</span>


| <span class="Latn" lang="lv">[[zilā#Latvian|zilā]]</span>


| <span class="Latn" lang="lv">[[zilās#Latvian|zilās]]</span>


|-

! style="background%3A%23EFEFEF" | vocative <small>([[vokatīvs]])</small>


| —


| —


| —


| —


|-

! colspan="10" style="background%3A%23DEDEDE%3Bheight%3A1em" |


|}
</div></div>
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form":
                "zils",
                "source":
                "Declension",
                "tags": ["indefinite", "masculine", "nominative", "singular"]
            }, {
                "form":
                "zili",
                "source":
                "Declension",
                "tags": ["indefinite", "masculine", "nominative", "plural"]
            }, {
                "form":
                "zila",
                "source":
                "Declension",
                "tags": ["feminine", "indefinite", "nominative", "singular"]
            }, {
                "form":
                "zilas",
                "source":
                "Declension",
                "tags": ["feminine", "indefinite", "nominative", "plural"]
            }, {
                "form":
                "zilu",
                "source":
                "Declension",
                "tags": ["accusative", "indefinite", "masculine", "singular"]
            }, {
                "form":
                "zilus",
                "source":
                "Declension",
                "tags": ["accusative", "indefinite", "masculine", "plural"]
            }, {
                "form":
                "zilu",
                "source":
                "Declension",
                "tags": ["accusative", "feminine", "indefinite", "singular"]
            }, {
                "form":
                "zilas",
                "source":
                "Declension",
                "tags": ["accusative", "feminine", "indefinite", "plural"]
            }, {
                "form":
                "zila",
                "source":
                "Declension",
                "tags": ["genitive", "indefinite", "masculine", "singular"]
            }, {
                "form": "zilu",
                "source": "Declension",
                "tags": ["genitive", "indefinite", "masculine", "plural"]
            }, {
                "form":
                "zilas",
                "source":
                "Declension",
                "tags": ["feminine", "genitive", "indefinite", "singular"]
            }, {
                "form": "zilu",
                "source": "Declension",
                "tags": ["feminine", "genitive", "indefinite", "plural"]
            }, {
                "form": "zilam",
                "source": "Declension",
                "tags": ["dative", "indefinite", "masculine", "singular"]
            }, {
                "form": "ziliem",
                "source": "Declension",
                "tags": ["dative", "indefinite", "masculine", "plural"]
            }, {
                "form": "zilai",
                "source": "Declension",
                "tags": ["dative", "feminine", "indefinite", "singular"]
            }, {
                "form": "zilām",
                "source": "Declension",
                "tags": ["dative", "feminine", "indefinite", "plural"]
            }, {
                "form":
                "zilu",
                "source":
                "Declension",
                "tags":
                ["indefinite", "instrumental", "masculine", "singular"]
            }, {
                "form":
                "ziliem",
                "source":
                "Declension",
                "tags": ["indefinite", "instrumental", "masculine", "plural"]
            }, {
                "form":
                "zilu",
                "source":
                "Declension",
                "tags": ["feminine", "indefinite", "instrumental", "singular"]
            }, {
                "form":
                "zilām",
                "source":
                "Declension",
                "tags": ["feminine", "indefinite", "instrumental", "plural"]
            }, {
                "form":
                "zilā",
                "source":
                "Declension",
                "tags": ["indefinite", "locative", "masculine", "singular"]
            }, {
                "form": "zilos",
                "source": "Declension",
                "tags": ["indefinite", "locative", "masculine", "plural"]
            }, {
                "form":
                "zilā",
                "source":
                "Declension",
                "tags": ["feminine", "indefinite", "locative", "singular"]
            }, {
                "form": "zilās",
                "source": "Declension",
                "tags": ["feminine", "indefinite", "locative", "plural"]
            }, {
                'form':
                '-',
                'source':
                'Declension',
                'tags': ['indefinite', 'masculine', 'singular', 'vocative']
            }, {
                'form': '-',
                'source': 'Declension',
                'tags': ['indefinite', 'masculine', 'plural', 'vocative']
            }, {
                'form':
                '-',
                'source':
                'Declension',
                'tags': ['feminine', 'indefinite', 'singular', 'vocative']
            }, {
                'form': '-',
                'source': 'Declension',
                'tags': ['feminine', 'indefinite', 'plural', 'vocative']
            }],
        }
        self.assertEqual(expected, ret)
示例#2
0
class InflTests(unittest.TestCase):
    def setUp(self):
        self.maxDiff = 100000
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def xinfl(self, word, lang, pos, section, text):
        """Runs a single inflection table parsing test, and returns ``data``."""
        self.ctx.start_page(word)
        self.ctx.start_section(lang)
        self.ctx.start_subsection(pos)
        tree = self.ctx.parse(text)
        data = {}
        parse_inflection_section(self.config, self.ctx, data, word, lang, pos,
                                 section, tree)
        return data

    def test_Russian_adj1(self):
        ret = self.xinfl(
            "следующий", "Russian", "adj", "Declension", """
<div>
<div class="NavFrame" style="display%3A+inline-block%3B+min-width%3A+70em">
<div class="NavHead" style="background%3A%23eff7ff">Declension of <b lang="ru" class="Cyrl"><span class="Cyrl" lang="ru">сле́дующий</span></b> (unknown short forms)</div>
<div class="NavContent">

{| style="background%3A%23F9F9F9%3Btext-align%3Acenter%3B+min-width%3A70em" class="inflection-table"

|-

! style="width%3A20%25%3Bbackground%3A%23d9ebff" colspan="2" |


! style="background%3A%23d9ebff" | masculine


! style="background%3A%23d9ebff" | neuter


! style="background%3A%23d9ebff" | feminine


! style="background%3A%23d9ebff" | plural


|-

! style="background%3A%23eff7ff" colspan="2" | nominative


| <span class="Cyrl+form-of+lang-ru+nom%7Cm%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующий#Russian|сле́дующий]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščij</span>


| <span class="Cyrl+form-of+lang-ru+nom%7Cn%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующее#Russian|сле́дующее]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščeje</span>


| <span class="Cyrl+form-of+lang-ru+nom%7Cf%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующая#Russian|сле́дующая]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščaja</span>


| <span class="Cyrl+form-of+lang-ru+nom%7Cp-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующие#Russian|сле́дующие]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščije</span>


|-

! style="background%3A%23eff7ff" colspan="2" | genitive


| colspan="2" | <span class="Cyrl+form-of+lang-ru+gen%7Cm%2F%2Fn%7Cs-form-of+++transliteration-sl%C3%A9duju%C5%A1%C4%8Devo+origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующего#Russian|сле́дующего]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščevo</span>


| <span class="Cyrl+form-of+lang-ru+gen%7Cf%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующей#Russian|сле́дующей]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščej</span>


| <span class="Cyrl+form-of+lang-ru+gen%7Cp-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующих#Russian|сле́дующих]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščix</span>


|-

! style="background%3A%23eff7ff" colspan="2" | dative


| colspan="2" | <span class="Cyrl+form-of+lang-ru+dat%7Cm%2F%2Fn%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующему#Russian|сле́дующему]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščemu</span>


| <span class="Cyrl+form-of+lang-ru+dat%7Cf%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующей#Russian|сле́дующей]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščej</span>


| <span class="Cyrl+form-of+lang-ru+dat%7Cp-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующим#Russian|сле́дующим]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščim</span>


|-

! style="background%3A%23eff7ff" rowspan="2" | accusative


! style="background%3A%23eff7ff" | animate


| <span class="Cyrl+form-of+lang-ru+an%7Cacc%7Cm%7Cs-form-of+++transliteration-sl%C3%A9duju%C5%A1%C4%8Devo+origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующего#Russian|сле́дующего]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščevo</span>


| rowspan="2" | <span class="Cyrl+form-of+lang-ru+acc%7Cn%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующее#Russian|сле́дующее]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščeje</span>


| rowspan="2" | <span class="Cyrl+form-of+lang-ru+acc%7Cf%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующую#Russian|сле́дующую]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščuju</span>


| <span class="Cyrl+form-of+lang-ru+an%7Cacc%7Cp-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующих#Russian|сле́дующих]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščix</span>


|-

! style="background%3A%23eff7ff" | inanimate


| <span class="Cyrl+form-of+lang-ru+in%7Cacc%7Cm%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующий#Russian|сле́дующий]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščij</span>


| <span class="Cyrl+form-of+lang-ru+in%7Cacc%7Cp-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующие#Russian|сле́дующие]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščije</span>


|-

! style="background%3A%23eff7ff" colspan="2" | instrumental


| colspan="2" | <span class="Cyrl+form-of+lang-ru+ins%7Cm%2F%2Fn%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующим#Russian|сле́дующим]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščim</span>


| <span class="Cyrl+form-of+lang-ru+ins%7Cf%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующей#Russian|сле́дующей]]</span>, <span class="Cyrl+form-of+lang-ru+ins%7Cf%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующею#Russian|сле́дующею]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščej</span>, <span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščeju</span>


| <span class="Cyrl+form-of+lang-ru+ins%7Cp-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующими#Russian|сле́дующими]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščimi</span>


|-

! style="background%3A%23eff7ff" colspan="2" | prepositional


| colspan="2" | <span class="Cyrl+form-of+lang-ru+pre%7Cm%2F%2Fn%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующем#Russian|сле́дующем]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščem</span>


| <span class="Cyrl+form-of+lang-ru+pre%7Cf%7Cs-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующей#Russian|сле́дующей]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščej</span>


| <span class="Cyrl+form-of+lang-ru+pre%7Cp-form-of++++origin-%D1%81%D0%BB%D0%B5%CC%81%D0%B4%D1%83%D1%8E%D1%89%D0%B8%D0%B9+++" lang="ru">[[следующих#Russian|сле́дующих]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888%3B">slédujuščix</span>


|-

|}
</div></div></div>[[Category:Russian sibilant-stem stem-stressed adjectives|СЛЕДУЮЩИЙ]]
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form": "сле́дующий",
                "roman": "slédujuščij",
                "source": "Declension",
                "tags": ["masculine", "nominative"]
            }, {
                "form": "сле́дующее",
                "roman": "slédujuščeje",
                "source": "Declension",
                "tags": ["neuter", "nominative"]
            }, {
                "form": "сле́дующая",
                "roman": "slédujuščaja",
                "source": "Declension",
                "tags": ["feminine", "nominative"]
            }, {
                "form": "сле́дующие",
                "roman": "slédujuščije",
                "source": "Declension",
                "tags": ["nominative", "plural"]
            }, {
                "form": "сле́дующего",
                "roman": "slédujuščevo",
                "source": "Declension",
                "tags": ["genitive", "masculine", "neuter"]
            }, {
                "form": "сле́дующей",
                "roman": "slédujuščej",
                "source": "Declension",
                "tags": ["feminine", "genitive"]
            }, {
                "form": "сле́дующих",
                "roman": "slédujuščix",
                "source": "Declension",
                "tags": ["genitive", "plural"]
            }, {
                "form": "сле́дующему",
                "roman": "slédujuščemu",
                "source": "Declension",
                "tags": ["dative", "masculine", "neuter"]
            }, {
                "form": "сле́дующей",
                "roman": "slédujuščej",
                "source": "Declension",
                "tags": ["dative", "feminine"]
            }, {
                "form": "сле́дующим",
                "roman": "slédujuščim",
                "source": "Declension",
                "tags": ["dative", "plural"]
            }, {
                "form": "сле́дующего",
                "roman": "slédujuščevo",
                "source": "Declension",
                "tags": ["accusative", "animate", "masculine"]
            }, {
                "form": "сле́дующее",
                "roman": "slédujuščeje",
                "source": "Declension",
                "tags": ["accusative", "neuter"]
            }, {
                "form": "сле́дующую",
                "roman": "slédujuščuju",
                "source": "Declension",
                "tags": ["accusative", "feminine"]
            }, {
                "form": "сле́дующих",
                "roman": "slédujuščix",
                "source": "Declension",
                "tags": ["accusative", "animate", "plural"]
            }, {
                "form": "сле́дующий",
                "roman": "slédujuščij",
                "source": "Declension",
                "tags": ["accusative", "inanimate", "masculine"]
            }, {
                "form": "сле́дующие",
                "roman": "slédujuščije",
                "source": "Declension",
                "tags": ["accusative", "inanimate", "plural"]
            }, {
                "form": "сле́дующим",
                "roman": "slédujuščim",
                "source": "Declension",
                "tags": ["instrumental", "masculine", "neuter"]
            }, {
                "form": "сле́дующей",
                "roman": "slédujuščej",
                "source": "Declension",
                "tags": ["feminine", "instrumental"]
            }, {
                "form": "сле́дующею",
                "roman": "slédujuščeju",
                "source": "Declension",
                "tags": ["feminine", "instrumental"]
            }, {
                "form": "сле́дующими",
                "roman": "slédujuščimi",
                "source": "Declension",
                "tags": ["instrumental", "plural"]
            }, {
                "form": "сле́дующем",
                "roman": "slédujuščem",
                "source": "Declension",
                "tags": ["masculine", "neuter", "prepositional"]
            }, {
                "form": "сле́дующей",
                "roman": "slédujuščej",
                "source": "Declension",
                "tags": ["feminine", "prepositional"]
            }, {
                "form": "сле́дующих",
                "roman": "slédujuščix",
                "source": "Declension",
                "tags": ["plural", "prepositional"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Russian_verb1(self):
        ret = self.xinfl(
            "произносить", "Russian", "verb", "Conjugation", """
<templatestyles src="Module%3Aru-verb%2Fstyle.css"><div class="NavFrame" style="width%3A49.6em%3B">
<div class="NavHead" style="text-align%3Aleft%3B+background%3A%23e0e0ff%3B">Conjugation of <span lang="ru" class="Cyrl">''произноси́ть''</span> (class 4c imperfective transitive)</div>
<div class="NavContent">

{| class="inflection+inflection-ru+inflection-verb+inflection-table"

|+
 Note: For declension of participles, see their entries. Adverbial participles are indeclinable.

|- class="rowgroup"

! colspan="3" | [[несовершенный вид|imperfective aspect]]


|-

! [[неопределённая форма|infinitive]]


| colspan="2" | <span class="Cyrl+form-of+lang-ru+inf-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносить#Russian|произноси́ть]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosítʹ</span>


|- class="rowgroup"

! style="width%3A15em" | [[причастие|participles]]


! [[настоящее время|present tense]]


! [[прошедшее время|past tense]]


|-

! [[действительный залог|active]]


| <span class="Cyrl+form-of+lang-ru+pres%7Cact%7Cpart-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносящий#Russian|произнося́щий]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosjáščij</span>

| <span class="Cyrl+form-of+lang-ru+past%7Cact%7Cpart-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносивший#Russian|произноси́вший]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosívšij</span>


|-

! [[страдательный залог|passive]]


| <span class="Cyrl+form-of+lang-ru+pres%7Cpass%7Cpart-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносимый#Russian|произноси́мый]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosímyj</span>

| &mdash;


|-

! [[деепричастие|adverbial]]


| <span class="Cyrl+form-of+lang-ru+pres%7Cadv%7Cpart-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произнося#Russian|произнося́]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosjá</span>

| <span class="Cyrl+form-of+lang-ru+past%7Cadv%7Cpart-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносив#Russian|произноси́в]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosív</span>,<br><span class="Cyrl+form-of+lang-ru+past%7Cadv%7Cpart-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносивши#Russian|произноси́вши]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosívši</span>


|- class="rowgroup"

!


! [[настоящее время|present tense]]


! [[будущее время|future tense]]


|-

! [[первое лицо|1st]] [[единственное число|singular]] (<span lang="ru" class="Cyrl">я</span>)


| <span class="Cyrl+form-of+lang-ru+1%7Cs%7Cpres%7Cind-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произношу#Russian|произношу́]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznošú</span>

| <span class="Cyrl" lang="ru">[[буду#Russian|бу́ду]]</span><span lang="ru" class="Cyrl"> произноси́ть</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">búdu proiznosítʹ</span>


|-

! [[второе лицо|2nd]] [[единственное число|singular]] (<span lang="ru" class="Cyrl">ты</span>)


| <span class="Cyrl+form-of+lang-ru+2%7Cs%7Cpres%7Cind-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносишь#Russian|произно́сишь]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznósišʹ</span>

| <span class="Cyrl" lang="ru">[[будешь#Russian|бу́дешь]]</span><span lang="ru" class="Cyrl"> произноси́ть</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">búdešʹ proiznosítʹ</span>


|-

! [[третье лицо|3rd]] [[единственное число|singular]] (<span lang="ru" class="Cyrl">он/она́/оно́</span>)


| <span class="Cyrl+form-of+lang-ru+3%7Cs%7Cpres%7Cind-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносит#Russian|произно́сит]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznósit</span>

| <span class="Cyrl" lang="ru">[[будет#Russian|бу́дет]]</span><span lang="ru" class="Cyrl"> произноси́ть</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">búdet proiznosítʹ</span>


|-

! [[первое лицо|1st]] [[множественное число|plural]] (<span lang="ru" class="Cyrl">мы</span>)


| <span class="Cyrl+form-of+lang-ru+1%7Cp%7Cpres%7Cind-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносим#Russian|произно́сим]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznósim</span>

| <span class="Cyrl" lang="ru">[[будем#Russian|бу́дем]]</span><span lang="ru" class="Cyrl"> произноси́ть</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">búdem proiznosítʹ</span>


|-

! [[второе лицо|2nd]] [[множественное число|plural]] (<span lang="ru" class="Cyrl">вы</span>)


| <span class="Cyrl+form-of+lang-ru+2%7Cp%7Cpres%7Cind-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносите#Russian|произно́сите]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznósite</span>

| <span class="Cyrl" lang="ru">[[будете#Russian|бу́дете]]</span><span lang="ru" class="Cyrl"> произноси́ть</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">búdete proiznosítʹ</span>


|-

! [[третье лицо|3rd]] [[множественное число|plural]] (<span lang="ru" class="Cyrl">они́</span>)


| <span class="Cyrl+form-of+lang-ru+3%7Cp%7Cpres%7Cind-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносят#Russian|произно́сят]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznósjat</span>

| <span class="Cyrl" lang="ru">[[будут#Russian|бу́дут]]</span><span lang="ru" class="Cyrl"> произноси́ть</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">búdut proiznosítʹ</span>


|- class="rowgroup"

! [[повелительное наклонение|imperative]]


! [[единственное число|singular]]


! [[множественное число|plural]]


|-

!


| <span class="Cyrl+form-of+lang-ru+2%7Cs%7Cimp-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произноси#Russian|произноси́]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosí</span>

| <span class="Cyrl+form-of+lang-ru+2%7Cp%7Cimp-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносите#Russian|произноси́те]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosíte</span>


|- class="rowgroup"

! [[прошедшее время|past tense]]


! [[единственное число|singular]]


! [[множественное число|plural]]<br>(<span lang="ru" class="Cyrl">мы/вы/они́</span>)


|-

! [[мужской род|masculine]] (<span lang="ru" class="Cyrl">я/ты/он</span>)


| <span class="Cyrl+form-of+lang-ru+m%7Cs%7Cpast%7Cind-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносил#Russian|произноси́л]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosíl</span>

| rowspan="3" | <span class="Cyrl+form-of+lang-ru+p%7Cpast%7Cind-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносили#Russian|произноси́ли]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosíli</span>


|-

! [[женский род|feminine]] (<span lang="ru" class="Cyrl">я/ты/она́</span>)


| <span class="Cyrl+form-of+lang-ru+f%7Cs%7Cpast%7Cind-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносила#Russian|произноси́ла]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosíla</span>


|-

! style="background-color%3A+%23ffffe0%3B" | [[средний род|neuter]] (<span lang="ru" class="Cyrl">оно́</span>)


| <span class="Cyrl+form-of+lang-ru+n%7Cs%7Cpast%7Cind-form-of++++origin-%D0%BF%D1%80%D0%BE%D0%B8%D0%B7%D0%BD%D0%BE%D1%81%D0%B8%CC%81%D1%82%D1%8C+++" lang="ru">[[произносило#Russian|произноси́ло]]</span><br><span lang="ru-Latn" class="tr+Latn" style="color%3A+%23888">proiznosílo</span>


|}

</div>
</div>[[Category:Russian class 4 verbs|ПРОИЗНОСИТЬ]][[Category:Russian class 4c verbs|ПРОИЗНОСИТЬ]][[Category:Russian imperfective verbs|ПРОИЗНОСИТЬ]][[Category:Russian transitive verbs|ПРОИЗНОСИТЬ]]
""")
        expected = {
            "forms": [{
                "form": "imperfective transitive",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form": "4c imperfective transitive",
                "source": "Conjugation",
                "tags": ["class"]
            }, {
                "form": "произноси́ть",
                "roman": "proiznosítʹ",
                "source": "Conjugation",
                "tags": ["imperfective", "infinitive"]
            }, {
                "form": "произнося́щий",
                "roman": "proiznosjáščij",
                "source": "Conjugation",
                "tags": ["active", "participle", "present"]
            }, {
                "form": "произноси́вший",
                "roman": "proiznosívšij",
                "source": "Conjugation",
                "tags": ["active", "participle", "past"]
            }, {
                "form": "произноси́мый",
                "roman": "proiznosímyj",
                "source": "Conjugation",
                "tags": ["participle", "passive", "present"]
            }, {
                "form": "-",
                "source": "Conjugation",
                "tags": ["participle", "passive", "past"]
            }, {
                "form": "произнося́",
                "roman": "proiznosjá",
                "source": "Conjugation",
                "tags": ["adverbial", "participle", "present"]
            }, {
                "form": "произноси́в",
                "roman": "proiznosív",
                "source": "Conjugation",
                "tags": ["adverbial", "participle", "past"]
            }, {
                "form": "произноси́вши",
                "roman": "proiznosívši",
                "source": "Conjugation",
                "tags": ["adverbial", "participle", "past"]
            }, {
                "form": "произношу́",
                "roman": "proiznošú",
                "source": "Conjugation",
                "tags": ["first-person", "present", "singular"]
            }, {
                "form": "бу́ду произноси́ть",
                "roman": "búdu proiznosítʹ",
                "source": "Conjugation",
                "tags": ["first-person", "future", "singular"]
            }, {
                "form": "произно́сишь",
                "roman": "proiznósišʹ",
                "source": "Conjugation",
                "tags": ["present", "second-person", "singular"]
            }, {
                "form": "бу́дешь произноси́ть",
                "roman": "búdešʹ proiznosítʹ",
                "source": "Conjugation",
                "tags": ["future", "second-person", "singular"]
            }, {
                "form": "произно́сит",
                "roman": "proiznósit",
                "source": "Conjugation",
                "tags": ["present", "singular", "third-person"]
            }, {
                "form": "бу́дет произноси́ть",
                "roman": "búdet proiznosítʹ",
                "source": "Conjugation",
                "tags": ["future", "singular", "third-person"]
            }, {
                "form": "произно́сим",
                "roman": "proiznósim",
                "source": "Conjugation",
                "tags": ["first-person", "plural", "present"]
            }, {
                "form": "бу́дем произноси́ть",
                "roman": "búdem proiznosítʹ",
                "source": "Conjugation",
                "tags": ["first-person", "future", "plural"]
            }, {
                "form": "произно́сите",
                "roman": "proiznósite",
                "source": "Conjugation",
                "tags": ["plural", "present", "second-person"]
            }, {
                "form": "бу́дете произноси́ть",
                "roman": "búdete proiznosítʹ",
                "source": "Conjugation",
                "tags": ["future", "plural", "second-person"]
            }, {
                "form": "произно́сят",
                "roman": "proiznósjat",
                "source": "Conjugation",
                "tags": ["plural", "present", "third-person"]
            }, {
                "form": "бу́дут произноси́ть",
                "roman": "búdut proiznosítʹ",
                "source": "Conjugation",
                "tags": ["future", "plural", "third-person"]
            }, {
                "form": "произноси́",
                "roman": "proiznosí",
                "source": "Conjugation",
                "tags": ["imperative", "singular"]
            }, {
                "form": "произноси́те",
                "roman": "proiznosíte",
                "source": "Conjugation",
                "tags": ["imperative", "plural"]
            }, {
                "form": "произноси́л",
                "roman": "proiznosíl",
                "source": "Conjugation",
                "tags": ["masculine", "past", "singular"]
            }, {
                "form": "произноси́ли",
                "roman": "proiznosíli",
                "source": "Conjugation",
                "tags": ["masculine", "past", "plural"]
            }, {
                "form": "произноси́ла",
                "roman": "proiznosíla",
                "source": "Conjugation",
                "tags": ["feminine", "past", "singular"]
            }, {
                "form": "произноси́ли",
                "roman": "proiznosíli",
                "source": "Conjugation",
                "tags": ["feminine", "past", "plural"]
            }, {
                "form": "произноси́ло",
                "roman": "proiznosílo",
                "source": "Conjugation",
                "tags": ["neuter", "past", "singular"]
            }, {
                "form": "произноси́ли",
                "roman": "proiznosíli",
                "source": "Conjugation",
                "tags": ["neuter", "past", "plural"]
            }],
        }
        self.assertEqual(expected, ret)
示例#3
0
class InflTests(unittest.TestCase):
    def setUp(self):
        self.maxDiff = 100000
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def xinfl(self, word, lang, pos, section, text):
        """Runs a single inflection table parsing test, and returns ``data``."""
        self.ctx.start_page(word)
        self.ctx.start_section(lang)
        self.ctx.start_subsection(pos)
        tree = self.ctx.parse(text)
        data = {}
        parse_inflection_section(self.config, self.ctx, data, word, lang, pos,
                                 section, tree)
        return data

    def test_Portuguese_verb1(self):
        ret = self.xinfl(
            "viajar", "Portuguese", "verb", "Conjugation", """
<div class="NavFrame" style="clear%3Aboth%3B+white-space%3A+nowrap">
<div class="NavHead">&nbsp;&nbsp;Conjugation of the [[Appendix:Portuguese verbs|Portuguese ''-ar'' verb]] ''viajar''</div>
<div class="NavContent" align="left">

{| class="inflection-table" style="background%3A%23F6F6F6%3B+text-align%3A+left%3B+border%3A+1px+solid+%23999999%3B" cellpadding="3" cellspacing="0"

|-

| style="border%3A+1px+solid+%23999999%3B" colspan="7" | '''Notes''':<sup class="plainlinks">[//wiki.local/w/index.php?action=edit&title=Module%3Apt-conj%2Fdata%2F-ar [edit]]</sup>
* This is a regular verb of the '''-ar''' group.
*
* Verbs with this conjugation include: <i class="Latn+mention" lang="pt">[[amar#Portuguese|amar]]</i>, <i class="Latn+mention" lang="pt">[[cantar#Portuguese|cantar]]</i>, <i class="Latn+mention" lang="pt">[[gritar#Portuguese|gritar]]</i>, <i class="Latn+mention" lang="pt">[[marchar#Portuguese|marchar]]</i>, <i class="Latn+mention" lang="pt">[[mostrar#Portuguese|mostrar]]</i>, <i class="Latn+mention" lang="pt">[[nadar#Portuguese|nadar]]</i>, <i class="Latn+mention" lang="pt">[[parar#Portuguese|parar]]</i>, <i class="Latn+mention" lang="pt">[[participar#Portuguese|participar]]</i>, <i class="Latn+mention" lang="pt">[[retirar#Portuguese|retirar]]</i>, <i class="Latn+mention" lang="pt">[[separar#Portuguese|separar]]</i>, <i class="Latn+mention" lang="pt">[[viajar#Portuguese|viajar]]</i>.


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23B0B0B0" rowspan="2" |


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0" colspan="3" | Singular


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0" colspan="3" | Plural


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0%3B+width%3A12.5%25" | First-person<br>([[eu#Portuguese|eu]])


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0%3B+width%3A12.5%25" | Second-person<br>([[tu#Portuguese|tu]])


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0%3B+width%3A12.5%25" | Third-person<br>([[ele#Portuguese|ele]] / [[ela#Portuguese|ela]] / [[você#Portuguese|você]])


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0%3B+width%3A12.5%25" | First-person<br>([[nós#Portuguese|nós]])


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0%3B+width%3A12.5%25" | Second-person<br>([[vós#Portuguese|vós]])


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0%3B+width%3A12.5%25" | Third-person<br>([[eles#Portuguese|eles]] / [[elas#Portuguese|elas]] / [[vocês#Portuguese|vocês]])


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23c498ff" colspan="7" | ''<span title="infinitivo">Infinitive</span>''


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23a478df" | '''<span title="infinitivo+impessoal">Impersonal</span>'''


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" colspan="6" | <span class="Latn" lang="pt">[[viajar#Portuguese|viajar]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23a478df" | '''<span title="infinitivo+pessoal">Personal</span>'''


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajar#Portuguese|viajar]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajares#Portuguese|viajares]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajar#Portuguese|viajar]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajarmos#Portuguese|viajarmos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajardes#Portuguese|viajardes]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajarem#Portuguese|viajarem]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%2398ffc4" colspan="7" | ''<span title="ger%C3%BAndio">Gerund</span>''


|-

| style="border%3A+1px+solid+%23999999%3B+background%3A%2378dfa4" |


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" colspan="6" | <span class="Latn" lang="pt">[[viajando#Portuguese|viajando]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23ffc498" colspan="7" | ''<span title="partic%C3%ADpio+passado">Past participle</span>''


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23dfa478" | Masculine


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" colspan="3" | <span class="Latn" lang="pt">[[viajado#Portuguese|viajado]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" colspan="3" | <span class="Latn" lang="pt">[[viajados#Portuguese|viajados]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23dfa478" | Feminine


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" colspan="3" | <span class="Latn" lang="pt">[[viajada#Portuguese|viajada]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" colspan="3" | <span class="Latn" lang="pt">[[viajadas#Portuguese|viajadas]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23d0dff4" colspan="7" | ''<span title="indicativo">Indicative</span>''


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0bfd4" | <span title="presente">Present</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajo#Portuguese|viajo]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajas#Portuguese|viajas]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viaja#Portuguese|viaja]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajamos#Portuguese|viajamos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajais#Portuguese|viajais]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajam#Portuguese|viajam]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0bfd4" | <span title="pret%C3%A9rito+imperfeito">Imperfect</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajava#Portuguese|viajava]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajavas#Portuguese|viajavas]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajava#Portuguese|viajava]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajávamos#Portuguese|viajávamos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajáveis#Portuguese|viajáveis]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajavam#Portuguese|viajavam]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0bfd4" | <span title="pret%C3%A9rito+perfeito">Preterite</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajei#Portuguese|viajei]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajaste#Portuguese|viajaste]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajou#Portuguese|viajou]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajamos#Portuguese|viajamos]]</span><br><span class="Latn" lang="pt">[[viajámos#Portuguese|viajámos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajastes#Portuguese|viajastes]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajaram#Portuguese|viajaram]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0bfd4" | <span title="pret%C3%A9rito+mais-que-perfeito+simples">Pluperfect</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajara#Portuguese|viajara]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajaras#Portuguese|viajaras]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajara#Portuguese|viajara]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajáramos#Portuguese|viajáramos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajáreis#Portuguese|viajáreis]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajaram#Portuguese|viajaram]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0bfd4" | <span title="futuro+do+presente">Future</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajarei#Portuguese|viajarei]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajarás#Portuguese|viajarás]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajará#Portuguese|viajará]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajaremos#Portuguese|viajaremos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajareis#Portuguese|viajareis]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajarão#Portuguese|viajarão]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23ffffaa" colspan="7" | ''<span title="condicional+%2F+futuro+do+pret%C3%A9rito">Conditional</span>''


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23ddddaa" |


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajaria#Portuguese|viajaria]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajarias#Portuguese|viajarias]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajaria#Portuguese|viajaria]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajaríamos#Portuguese|viajaríamos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajaríeis#Portuguese|viajaríeis]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajariam#Portuguese|viajariam]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23d0f4d0" colspan="7" | ''<span title="conjuntivo+%28pt%29+%2F+subjuntivo+%28br%29">Subjunctive</span>''


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0d4b0" | <span title="+presente+do+conjuntivo+%28pt%29+%2F+subjuntivo+%28br%29">Present</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viaje#Portuguese|viaje]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajes#Portuguese|viajes]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viaje#Portuguese|viaje]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajemos#Portuguese|viajemos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajeis#Portuguese|viajeis]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajem#Portuguese|viajem]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0d4b0" | <span title="pret%C3%A9rito+imperfeito+do+conjuntivo+%28pt%29+%2F+subjuntivo+%28br%29">Imperfect</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajasse#Portuguese|viajasse]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajasses#Portuguese|viajasses]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajasse#Portuguese|viajasse]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajássemos#Portuguese|viajássemos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajásseis#Portuguese|viajásseis]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajassem#Portuguese|viajassem]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0d4b0" | <span title="futuro+do+conjuntivo+%28pt%29+%2F+subjuntivo+%28br%29">Future</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajar#Portuguese|viajar]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajares#Portuguese|viajares]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajar#Portuguese|viajar]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajarmos#Portuguese|viajarmos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajardes#Portuguese|viajardes]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajarem#Portuguese|viajarem]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23f4e4d0" colspan="7" | ''<span title="imperativo">Imperative</span>''


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23d4c4b0" | <span title="imperativo+afirmativo">Affirmative</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | -


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viaja#Portuguese|viaja]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viaje#Portuguese|viaje]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajemos#Portuguese|viajemos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajai#Portuguese|viajai]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajem#Portuguese|viajem]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23d4c4b0" | <span title="imperativo+negativo">Negative</span> ([[não#Portuguese|não]])


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | -


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajes#Portuguese|viajes]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viaje#Portuguese|viaje]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajemos#Portuguese|viajemos]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajeis#Portuguese|viajeis]]</span>


| style="border%3A+1px+solid+%23999999%3B+vertical-align%3A+top%3B" | <span class="Latn" lang="pt">[[viajem#Portuguese|viajem]]</span>


|}

            </div>
            </div>
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form": "-ar verb",
                "source": "Conjugation",
                "tags": ["class"]
            }, {
                "form": "viajar",
                "source": "Conjugation",
                "tags": ["impersonal", "infinitive"]
            }, {
                "form": "viajar",
                "source": "Conjugation",
                "tags": ["first-person", "infinitive", "singular"]
            }, {
                "form": "viajares",
                "source": "Conjugation",
                "tags": ["infinitive", "second-person", "singular"]
            }, {
                "form": "viajar",
                "source": "Conjugation",
                "tags": ["infinitive", "singular", "third-person"]
            }, {
                "form": "viajarmos",
                "source": "Conjugation",
                "tags": ["first-person", "infinitive", "plural"]
            }, {
                "form": "viajardes",
                "source": "Conjugation",
                "tags": ["infinitive", "plural", "second-person"]
            }, {
                "form": "viajarem",
                "source": "Conjugation",
                "tags": ["infinitive", "plural", "third-person"]
            }, {
                "form": "viajando",
                "source": "Conjugation",
                "tags": ["gerund"]
            }, {
                "form": "viajado",
                "source": "Conjugation",
                "tags": ["masculine", "participle", "past", "singular"]
            }, {
                "form": "viajados",
                "source": "Conjugation",
                "tags": ["masculine", "participle", "past", "plural"]
            }, {
                "form": "viajada",
                "source": "Conjugation",
                "tags": ["feminine", "participle", "past", "singular"]
            }, {
                "form": "viajadas",
                "source": "Conjugation",
                "tags": ["feminine", "participle", "past", "plural"]
            }, {
                "form":
                "viajo",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "present", "singular"]
            }, {
                "form":
                "viajas",
                "source":
                "Conjugation",
                "tags": ["indicative", "present", "second-person", "singular"]
            }, {
                "form":
                "viaja",
                "source":
                "Conjugation",
                "tags": ["indicative", "present", "singular", "third-person"]
            }, {
                "form":
                "viajamos",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "plural", "present"]
            }, {
                "form":
                "viajais",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "second-person"]
            }, {
                "form":
                "viajam",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "third-person"]
            }, {
                "form":
                "viajava",
                "source":
                "Conjugation",
                "tags":
                ["first-person", "imperfect", "indicative", "singular"]
            }, {
                "form":
                "viajavas",
                "source":
                "Conjugation",
                "tags":
                ["imperfect", "indicative", "second-person", "singular"]
            }, {
                "form":
                "viajava",
                "source":
                "Conjugation",
                "tags":
                ["imperfect", "indicative", "singular", "third-person"]
            }, {
                "form":
                "viajávamos",
                "source":
                "Conjugation",
                "tags": ["first-person", "imperfect", "indicative", "plural"]
            }, {
                "form":
                "viajáveis",
                "source":
                "Conjugation",
                "tags": ["imperfect", "indicative", "plural", "second-person"]
            }, {
                "form":
                "viajavam",
                "source":
                "Conjugation",
                "tags": ["imperfect", "indicative", "plural", "third-person"]
            }, {
                "form":
                "viajei",
                "source":
                "Conjugation",
                "tags":
                ["first-person", "indicative", "preterite", "singular"]
            }, {
                "form":
                "viajaste",
                "source":
                "Conjugation",
                "tags":
                ["indicative", "preterite", "second-person", "singular"]
            }, {
                "form":
                "viajou",
                "source":
                "Conjugation",
                "tags":
                ["indicative", "preterite", "singular", "third-person"]
            }, {
                "form":
                "viajamos",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "plural", "preterite"]
            }, {
                "form":
                "viajámos",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "plural", "preterite"]
            }, {
                "form":
                "viajastes",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "preterite", "second-person"]
            }, {
                "form":
                "viajaram",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "preterite", "third-person"]
            }, {
                "form":
                "viajara",
                "source":
                "Conjugation",
                "tags":
                ["first-person", "indicative", "pluperfect", "singular"]
            }, {
                "form":
                "viajaras",
                "source":
                "Conjugation",
                "tags":
                ["indicative", "pluperfect", "second-person", "singular"]
            }, {
                "form":
                "viajara",
                "source":
                "Conjugation",
                "tags":
                ["indicative", "pluperfect", "singular", "third-person"]
            }, {
                "form":
                "viajáramos",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "pluperfect", "plural"]
            }, {
                "form":
                "viajáreis",
                "source":
                "Conjugation",
                "tags":
                ["indicative", "pluperfect", "plural", "second-person"]
            }, {
                "form":
                "viajaram",
                "source":
                "Conjugation",
                "tags": ["indicative", "pluperfect", "plural", "third-person"]
            }, {
                "form":
                "viajarei",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "indicative", "singular"]
            }, {
                "form":
                "viajarás",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "second-person", "singular"]
            }, {
                "form":
                "viajará",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "singular", "third-person"]
            }, {
                "form":
                "viajaremos",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "indicative", "plural"]
            }, {
                "form":
                "viajareis",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "plural", "second-person"]
            }, {
                "form":
                "viajarão",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "plural", "third-person"]
            }, {
                "form": "viajaria",
                "source": "Conjugation",
                "tags": ["conditional", "first-person", "singular"]
            }, {
                "form": "viajarias",
                "source": "Conjugation",
                "tags": ["conditional", "second-person", "singular"]
            }, {
                "form": "viajaria",
                "source": "Conjugation",
                "tags": ["conditional", "singular", "third-person"]
            }, {
                "form": "viajaríamos",
                "source": "Conjugation",
                "tags": ["conditional", "first-person", "plural"]
            }, {
                "form": "viajaríeis",
                "source": "Conjugation",
                "tags": ["conditional", "plural", "second-person"]
            }, {
                "form": "viajariam",
                "source": "Conjugation",
                "tags": ["conditional", "plural", "third-person"]
            }, {
                "form":
                "viaje",
                "source":
                "Conjugation",
                "tags": ["first-person", "present", "singular", "subjunctive"]
            }, {
                "form":
                "viajes",
                "source":
                "Conjugation",
                "tags":
                ["present", "second-person", "singular", "subjunctive"]
            }, {
                "form":
                "viaje",
                "source":
                "Conjugation",
                "tags": ["present", "singular", "subjunctive", "third-person"]
            }, {
                "form":
                "viajemos",
                "source":
                "Conjugation",
                "tags": ["first-person", "plural", "present", "subjunctive"]
            }, {
                "form":
                "viajeis",
                "source":
                "Conjugation",
                "tags": ["plural", "present", "second-person", "subjunctive"]
            }, {
                "form":
                "viajem",
                "source":
                "Conjugation",
                "tags": ["plural", "present", "subjunctive", "third-person"]
            }, {
                "form":
                "viajasse",
                "source":
                "Conjugation",
                "tags":
                ["first-person", "imperfect", "singular", "subjunctive"]
            }, {
                "form":
                "viajasses",
                "source":
                "Conjugation",
                "tags":
                ["imperfect", "second-person", "singular", "subjunctive"]
            }, {
                "form":
                "viajasse",
                "source":
                "Conjugation",
                "tags":
                ["imperfect", "singular", "subjunctive", "third-person"]
            }, {
                "form":
                "viajássemos",
                "source":
                "Conjugation",
                "tags": ["first-person", "imperfect", "plural", "subjunctive"]
            }, {
                "form":
                "viajásseis",
                "source":
                "Conjugation",
                "tags":
                ["imperfect", "plural", "second-person", "subjunctive"]
            }, {
                "form":
                "viajassem",
                "source":
                "Conjugation",
                "tags": ["imperfect", "plural", "subjunctive", "third-person"]
            }, {
                "form":
                "viajar",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "singular", "subjunctive"]
            }, {
                "form":
                "viajares",
                "source":
                "Conjugation",
                "tags": ["future", "second-person", "singular", "subjunctive"]
            }, {
                "form":
                "viajar",
                "source":
                "Conjugation",
                "tags": ["future", "singular", "subjunctive", "third-person"]
            }, {
                "form":
                "viajarmos",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "plural", "subjunctive"]
            }, {
                "form":
                "viajardes",
                "source":
                "Conjugation",
                "tags": ["future", "plural", "second-person", "subjunctive"]
            }, {
                "form":
                "viajarem",
                "source":
                "Conjugation",
                "tags": ["future", "plural", "subjunctive", "third-person"]
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['first-person', 'imperative', 'singular']
            }, {
                "form": "viaja",
                "source": "Conjugation",
                "tags": ["imperative", "second-person", "singular"]
            }, {
                "form": "viaje",
                "source": "Conjugation",
                "tags": ["imperative", "singular", "third-person"]
            }, {
                "form": "viajemos",
                "source": "Conjugation",
                "tags": ["first-person", "imperative", "plural"]
            }, {
                "form": "viajai",
                "source": "Conjugation",
                "tags": ["imperative", "plural", "second-person"]
            }, {
                "form": "viajem",
                "source": "Conjugation",
                "tags": ["imperative", "plural", "third-person"]
            }, {
                'form':
                '-',
                'source':
                'Conjugation',
                'tags': ['first-person', 'imperative', 'negative', 'singular']
            }, {
                "form":
                "viajes",
                "source":
                "Conjugation",
                "tags":
                ["imperative", "negative", "second-person", "singular"]
            }, {
                "form":
                "viaje",
                "source":
                "Conjugation",
                "tags": ["imperative", "negative", "singular", "third-person"]
            }, {
                "form":
                "viajemos",
                "source":
                "Conjugation",
                "tags": ["first-person", "imperative", "negative", "plural"]
            }, {
                "form":
                "viajeis",
                "source":
                "Conjugation",
                "tags": ["imperative", "negative", "plural", "second-person"]
            }, {
                "form":
                "viajem",
                "source":
                "Conjugation",
                "tags": ["imperative", "negative", "plural", "third-person"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Portuguese_adj1(self):
        ret = self.xinfl(
            "lindo", "Portuguese", "adj", "Conjugation", """
<div class="NavFrame" style="clear%3Aboth%3B+white-space%3A+nowrap%3B+max-width%3A+50em">
<div class="NavHead">Inflection of <i class="Latn+mention" lang="pt">lindo</i></div>
<div class="NavContent">

{| style="border%3A+1px+solid+%23999999%3B+width%3A+100%25%3B+background%3A%23F6F6F6%3B" cellpadding="3" cellspacing="0" class="inflection-table"

|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23B0B0B0" rowspan="2" |


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0" colspan="2" | singular


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0" colspan="2" | plural


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0%3B+width%3A21%25" | masculine


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0%3B+width%3A21%25" | feminine


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0%3B+width%3A21%25" | masculine


! style="border%3A+1px+solid+%23999999%3B+background%3A%23D0D0D0%3B+width%3A21%25" | feminine


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0bfd4" | [[Appendix:Glossary#positive|positive]]


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[lindo#Portuguese|lindo]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[linda#Portuguese|linda]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[lindos#Portuguese|lindos]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[lindas#Portuguese|lindas]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0bfd4" | [[Appendix:Glossary#comparative|comparative]]


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[mais#Portuguese|mais]] lindo</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[mais#Portuguese|mais]] linda</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[mais#Portuguese|mais]] lindos</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[mais#Portuguese|mais]] lindas</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0bfd4" | [[Appendix:Glossary#superlative|superlative]]


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[o#Portuguese|o]] [[mais#Portuguese|mais]] lindo</span><br><span class="Latn" lang="pt">[[lindíssimo#Portuguese|lindíssimo]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[a#Portuguese|a]] [[mais#Portuguese|mais]] linda</span><br><span class="Latn" lang="pt">[[lindíssima#Portuguese|lindíssima]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[os#Portuguese|os]] [[mais#Portuguese|mais]] lindos</span><br><span class="Latn" lang="pt">[[lindíssimos#Portuguese|lindíssimos]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[as#Portuguese|as]] [[mais#Portuguese|mais]] lindas</span><br><span class="Latn" lang="pt">[[lindíssimas#Portuguese|lindíssimas]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0bfd4" | [[Appendix:Glossary#augmentative|augmentative]]


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[lindão#Portuguese|lindão]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[lindona#Portuguese|lindona]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[lindões#Portuguese|lindões]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[lindonas#Portuguese|lindonas]]</span>


|-

! style="border%3A+1px+solid+%23999999%3B+background%3A%23b0bfd4" | [[Appendix:Glossary#diminutive|diminutive]]


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[lindinho#Portuguese|lindinho]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[lindinha#Portuguese|lindinha]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[lindinhos#Portuguese|lindinhos]]</span>


| style="border%3A+1px+solid+%23999999%3B" valign="top" | <span class="Latn" lang="pt">[[lindinhas#Portuguese|lindinhas]]</span>


|}
</div></div>
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form": "lindo",
                "source": "Conjugation",
                "tags": ["masculine", "positive", "singular"]
            }, {
                "form": "linda",
                "source": "Conjugation",
                "tags": ["feminine", "positive", "singular"]
            }, {
                "form": "lindos",
                "source": "Conjugation",
                "tags": ["masculine", "plural", "positive"]
            }, {
                "form": "lindas",
                "source": "Conjugation",
                "tags": ["feminine", "plural", "positive"]
            }, {
                "form": "mais lindo",
                "source": "Conjugation",
                "tags": ["comparative", "masculine", "singular"]
            }, {
                "form": "mais linda",
                "source": "Conjugation",
                "tags": ["comparative", "feminine", "singular"]
            }, {
                "form": "mais lindos",
                "source": "Conjugation",
                "tags": ["comparative", "masculine", "plural"]
            }, {
                "form": "mais lindas",
                "source": "Conjugation",
                "tags": ["comparative", "feminine", "plural"]
            }, {
                "form": "o mais lindo",
                "source": "Conjugation",
                "tags": ["masculine", "singular", "superlative"]
            }, {
                "form": "lindíssimo",
                "source": "Conjugation",
                "tags": ["masculine", "singular", "superlative"]
            }, {
                "form": "a mais linda",
                "source": "Conjugation",
                "tags": ["feminine", "singular", "superlative"]
            }, {
                "form": "lindíssima",
                "source": "Conjugation",
                "tags": ["feminine", "singular", "superlative"]
            }, {
                "form": "os mais lindos",
                "source": "Conjugation",
                "tags": ["masculine", "plural", "superlative"]
            }, {
                "form": "lindíssimos",
                "source": "Conjugation",
                "tags": ["masculine", "plural", "superlative"]
            }, {
                "form": "as mais lindas",
                "source": "Conjugation",
                "tags": ["feminine", "plural", "superlative"]
            }, {
                "form": "lindíssimas",
                "source": "Conjugation",
                "tags": ["feminine", "plural", "superlative"]
            }, {
                "form": "lindão",
                "source": "Conjugation",
                "tags": ["augmentative", "masculine", "singular"]
            }, {
                "form": "lindona",
                "source": "Conjugation",
                "tags": ["augmentative", "feminine", "singular"]
            }, {
                "form": "lindões",
                "source": "Conjugation",
                "tags": ["augmentative", "masculine", "plural"]
            }, {
                "form": "lindonas",
                "source": "Conjugation",
                "tags": ["augmentative", "feminine", "plural"]
            }, {
                "form": "lindinho",
                "source": "Conjugation",
                "tags": ["diminutive", "masculine", "singular"]
            }, {
                "form": "lindinha",
                "source": "Conjugation",
                "tags": ["diminutive", "feminine", "singular"]
            }, {
                "form": "lindinhos",
                "source": "Conjugation",
                "tags": ["diminutive", "masculine", "plural"]
            }, {
                "form": "lindinhas",
                "source": "Conjugation",
                "tags": ["diminutive", "feminine", "plural"]
            }],
        }
        self.assertEqual(expected, ret)
class InflTests(unittest.TestCase):

    def setUp(self):
        self.maxDiff = 100000
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def xinfl(self, word, lang, pos, section, text):
        """Runs a single inflection table parsing test, and returns ``data``."""
        self.ctx.start_page(word)
        self.ctx.start_section(lang)
        self.ctx.start_subsection(pos)
        tree = self.ctx.parse(text)
        data = {}
        parse_inflection_section(self.config, self.ctx, data, word, lang, pos,
                                 section, tree)
        return data

    def test_GermanLowGerman_verb1(self):
        ret = self.xinfl("kriegen", "German Low German", "verb",
                         "Conjugation", """
<div class="NavFrame" style="width%3A+42em">
<div class="NavHead" style="background%3A%23CCCCFF%3B">Conjugation of ''kriegen'' (class 1 strong verb)</div>
<div class="NavContent">

{| style="width%3A+100%25%3B+border%3A1px+solid+%23CCCCFF%3B+line-height%3A+125%25%3B+background-color%3A%23F9F9F9%3B+text-align%3Acenter%3B+border%3A+1px+solid+%23CCCCFF%3B" cellspacing="1" cellpadding="3" class="inflection-table"

|-
 style="background-color:#F2F2FF; "

|-

! style="background-color%3A%23dedeee%3B+font-weight%3Abold%3B" | [[infinitive]]


| colspan="2" style="background-color%3A%23EFEFEF%3B" | '''kriegen'''


|-

! style="background-color%3A%23CCCCFF%3B+font-weight%3Abold%3B" | [[indicative mood|indicative]]


! style="background-color%3A%23dedeee%3B+font-weight%3Abold%3B" | [[present tense|present]]


! style="background-color%3A%23dedeee%3B+font-weight%3Abold%3B" | [[preterite]]


|-

! style="background-color%3A%23eeeeee%3B+font-weight%3Abold%3B" |[[first-person|1st&nbsp;person]]&nbsp;[[singular]]


| style="background-color%3A%23efefff%3B" | krieg


| style="background-color%3A%23efefff%3B" | kreeg


|-

! style="background-color%3A%23eeeeee%3B+font-weight%3Abold%3B" |[[second-person|2nd&nbsp;person]]&nbsp;[[singular]]


| style="background-color%3A%23efefff%3B" | kriggs(t)


| style="background-color%3A%23efefff%3B" | kreegs(t)


|-

! style="background-color%3A%23eeeeee%3B+font-weight%3Abold%3B" |[[third-person|3rd&nbsp;person]]&nbsp;[[singular]]


| style="background-color%3A%23efefff%3B" | krigg(t)


| style="background-color%3A%23efefff%3B" | kreeg


|-

! style="background-color%3A%23eeeeee%3B+font-weight%3Abold%3B" |[[plural]]


| style="background-color%3A%23efefff%3B" | kriegt, kriegen


| style="background-color%3A%23efefff%3B" | kregen


|-

! style="background-color%3A%23CCCCFF%3B+font-weight%3Abold%3B" | [[imperative mood|imperative]]


! style="background-color%3A%23eedede%3B+font-weight%3Abold%3B" | [[present tense|present]]


! style="background-color%3A%23eedede%3B+font-weight%3Abold%3B" | —


|-

! style="background-color%3A%23eeeeee%3B+font-weight%3Abold%3B" |[[singular]]


| style="background-color%3A%23ffefef%3B" | krieg


| style="background-color%3A%23ffefef%3B" |


|-

! style="background-color%3A%23eeeeee%3B+font-weight%3Abold%3B" |[[plural]]


| style="background-color%3A%23ffefef%3B" | kriegt


| style="background-color%3A%23ffefef%3B" |


|-

! style="background-color%3A%23CCCCFF%3B+font-weight%3Abold%3B" | [[participle]]


! style="background-color%3A%23deeede%3B+font-weight%3Abold%3B" | [[present tense|present]]


! style="background-color%3A%23deeede%3B+font-weight%3Abold%3B" | [[past tense|past]]


|-

! style="background-color%3A%23eeeeee%3B+font-weight%3Abold%3B" |


| style="background-color%3A%23efffef%3B" | kriegen


| style="background-color%3A%23efffef%3B" | (e)kregen, gekregen


|-

! style="text+align%3Aleft%3B+font-weight%3A+normal" colspan="3" |Note: This conjugation is one of many; neither its grammar nor spelling apply to all dialects.


|}
</div></div>[[Category:Low German class 1 strong verbs]]
""")
        expected = {
            "forms": [
              {
                "form": "strong",
                "source": "Conjugation",
                "tags": [
                  "table-tags"
                ]
              },
              {
                "form": "1 strong verb",
                "source": "Conjugation",
                "tags": [
                  "class"
                ]
              },
              {
                "form": "kriegen",
                "source": "Conjugation",
                "tags": [
                  "infinitive"
                ]
              },
              {
                "form": "krieg",
                "source": "Conjugation",
                "tags": [
                  "first-person",
                  "indicative",
                  "present",
                  "singular"
                ]
              },
              {
                "form": "kreeg",
                "source": "Conjugation",
                "tags": [
                  "first-person",
                  "indicative",
                  "preterite",
                  "singular"
                ]
              },
              {
                "form": "kriggs",
                "source": "Conjugation",
                "tags": [
                  "indicative",
                  "present",
                  "second-person",
                  "singular"
                ]
              },
              {
                "form": "kriggst",
                "source": "Conjugation",
                "tags": [
                  "indicative",
                  "present",
                  "second-person",
                  "singular"
                ]
              },
              {
                "form": "kreegs",
                "source": "Conjugation",
                "tags": [
                  "indicative",
                  "preterite",
                  "second-person",
                  "singular"
                ]
              },
              {
                "form": "kreegst",
                "source": "Conjugation",
                "tags": [
                  "indicative",
                  "preterite",
                  "second-person",
                  "singular"
                ]
              },
              {
                "form": "krigg",
                "source": "Conjugation",
                "tags": [
                  "indicative",
                  "present",
                  "singular",
                  "third-person"
                ]
              },
              {
                "form": "kriggt",
                "source": "Conjugation",
                "tags": [
                  "indicative",
                  "present",
                  "singular",
                  "third-person"
                ]
              },
              {
                "form": "kreeg",
                "source": "Conjugation",
                "tags": [
                  "indicative",
                  "preterite",
                  "singular",
                  "third-person"
                ]
              },
              {
                "form": "kriegt",
                "source": "Conjugation",
                "tags": [
                  "indicative",
                  "plural",
                  "present"
                ]
              },
              {
                "form": "kriegen",
                "source": "Conjugation",
                "tags": [
                  "indicative",
                  "plural",
                  "present"
                ]
              },
              {
                "form": "kregen",
                "source": "Conjugation",
                "tags": [
                  "indicative",
                  "plural",
                  "preterite"
                ]
              },
              {
                "form": "krieg",
                "source": "Conjugation",
                "tags": [
                  "imperative",
                  "present",
                  "singular"
                ]
              },
              {
                "form": "kriegt",
                "source": "Conjugation",
                "tags": [
                  "imperative",
                  "plural",
                  "present"
                ]
              },
              {
                "form": "kriegen",
                "source": "Conjugation",
                "tags": [
                  "participle",
                  "present"
                ]
              },
              {
                "form": "kregen",
                "source": "Conjugation",
                "tags": ["participle", "past"],
              },
              {
                "form": "ekregen",
                "source": "Conjugation",
                "tags": [
                  "participle",
                  "past"
                ]
              },
              {
                "form": "gekregen",
                "source": "Conjugation",
                "tags": [
                  "participle",
                  "past"
                ]
              }
            ],
        }
        self.assertEqual(expected, ret)
class InflTests(unittest.TestCase):
    def setUp(self):
        self.maxDiff = 100000
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def xinfl(self, word, lang, pos, section, text):
        """Runs a single inflection table parsing test, and returns ``data``."""
        self.ctx.start_page(word)
        self.ctx.start_section(lang)
        self.ctx.start_subsection(pos)
        tree = self.ctx.parse(text)
        data = {}
        parse_inflection_section(self.config, self.ctx, data, word, lang, pos,
                                 section, tree)
        return data

    def test_Lombard_verb1(self):
        # The main point is to test global annotations from table header
        # going into the forms
        ret = self.xinfl(
            "baià", "Lombard", "verb", "Conjugation", """
<div class="NavFrame" style="text-align%3Acenter"><div class="NavHead">[[File:Flag of Milan.svg|20px]]&nbsp;&nbsp;Western Lombard conjugation of baià

([[:Category:Lombard transitive verbs|transitive]])</div><div class="NavContent">

{| style="text-align%3Acenter%3Bbackground%3A%23F9F9F9"

|-

! colspan="3" style="background%3A%23e2e4c0" |infinitive


| colspan="7" |<span class="Latn" lang="lmo">[[baià#Lombard|baià]]</span>


|-

! colspan="3" style="background%3A%23e2e4c0" |gerund


| colspan="7" |<span class="Latn" lang="lmo">[[baiànd#Lombard|baiànd]], [[baiàndo#Lombard|baiàndo]]</span>


|-

! colspan="3" style="background%3A%23e2e4c0" |past participle


| colspan="7" |<span class="Latn" lang="lmo">[[baiàa#Lombard|baiàa]]</span>


|-

! colspan="3" style="background%3A%23e2e4c0" |auxiliary verb


| colspan="7" |<span class="Latn" lang="lmo">[[avè#Lombard|avè]]</span>


|-

! rowspan="2" colspan="2" style="background%3A%23DEDEDE" |


! colspan="3" style="background%3A%23DEDEDE" |singular


! colspan="3" style="background%3A%23DEDEDE" |plural


|-

! style="background%3A%23DEDEDE" |first


! style="background%3A%23DEDEDE" |second


! style="background%3A%23DEDEDE" |third


! style="background%3A%23DEDEDE" |first


! style="background%3A%23DEDEDE" |second


! style="background%3A%23DEDEDE" |third


|-

! rowspan="4" style="background%3A%23c0cfe4" |indicative


! style="background%3A%23c0cfe4" |


! style="background%3A%23c0cfe4" |mì


! style="background%3A%23c0cfe4" |tì te


! style="background%3A%23c0cfe4" |lù el / lee la


! style="background%3A%23c0cfe4" |nun


! style="background%3A%23c0cfe4" |violter / vialter


! style="background%3A%23c0cfe4" |lor


|-

! style="background%3A%23c0cfe4%3Bheight%3A3em" |present


|<span class="Latn" lang="lmo">[[bàii#Lombard|bàii]]</span>


|<span class="Latn" lang="lmo">[[bàiet#Lombard|bàiet]]</span>


|<span class="Latn" lang="lmo">[[bàia#Lombard|bàia]]</span>


|<span class="Latn" lang="lmo">[[bàiom#Lombard|bàiom]]</span>


|<span class="Latn" lang="lmo">[[bàiov#Lombard|bàiov]], [[baiee#Lombard|baiee]]</span>


|<span class="Latn" lang="lmo">[[bàien#Lombard|bàien]]</span>


|-

! style="background%3A%23c0cfe4%3Bheight%3A3em" |imperfect


|<span class="Latn" lang="lmo">[[baiàvi#Lombard|baiàvi]]</span>


|<span class="Latn" lang="lmo">[[baiàvet#Lombard|baiàvet]]</span>


|<span class="Latn" lang="lmo">[[baiàva#Lombard|baiàva]]</span>


|<span class="Latn" lang="lmo">[[baiàvom#Lombard|baiàvom]]</span>


|<span class="Latn" lang="lmo">[[baiàvov#Lombard|baiàvov]]</span>


|<span class="Latn" lang="lmo">[[baiàven#Lombard|baiàven]]</span>


|-

! style="background%3A%23c0cfe4%3Bheight%3A3em" |future


|<span class="Latn" lang="lmo">[[baiaróo#Lombard|baiaróo]]</span>


|<span class="Latn" lang="lmo">[[baiaré#Lombard|baiaré]], [[baiarét#Lombard|baiarét]]</span>


|<span class="Latn" lang="lmo">[[baiarà#Lombard|baiarà]]</span>


|<span class="Latn" lang="lmo">[[baiarèmm#Lombard|baiarèmm]]</span>


|<span class="Latn" lang="lmo">[[baiarii#Lombard|baiarii]]</span>


|<span class="Latn" lang="lmo">[[baiarànn#Lombard|baiarànn]]</span>


|-

! rowspan="2" style="background%3A%23c0d8e4" |conditional


! style="background%3A%23c0d8e4" |


! style="background%3A%23c0d8e4" |mì


! style="background%3A%23c0d8e4" |tì te


! style="background%3A%23c0d8e4" |lù el / lee la


! style="background%3A%23c0d8e4" |nun


! style="background%3A%23c0d8e4" |violter / vialter


! style="background%3A%23c0d8e4" |lor


|-

! style="background%3A%23c0d8e4%3Bheight%3A3em" |present


|<span class="Latn" lang="lmo">[[baiarìa#Lombard|baiarìa]], [[baiarìss#Lombard|baiarìss]], [[baiarìssi#Lombard|baiarìssi]]</span>


|<span class="Latn" lang="lmo">[[baiarìet#Lombard|baiarìet]], [[baiarìsset#Lombard|baiarìsset]]</span>


|<span class="Latn" lang="lmo">[[baiarìa#Lombard|baiarìa]], [[baiarìss#Lombard|baiarìss]]</span>


|<span class="Latn" lang="lmo">[[baiarìom#Lombard|baiarìom]], [[baiarìssom#Lombard|baiarìssom]]</span>


|<span class="Latn" lang="lmo">[[baiarìov#Lombard|baiarìov]], [[baiarìssov#Lombard|baiarìssov]]</span>


|<span class="Latn" lang="lmo">[[baiarìen#Lombard|baiarìen]], [[baiarìssen#Lombard|baiarìssen]]</span>


|-

! rowspan="3" style="background%3A%23c0e4c0" |subjunctive


! style="background%3A%23c0e4c0" |


! style="background%3A%23c0e4c0" |(che) mì


! style="background%3A%23c0e4c0" |(che) tì te


! style="background%3A%23c0e4c0" |(che) lù el / lee la


! style="background%3A%23c0e4c0" |(che) nun


! style="background%3A%23c0e4c0" |(che) violter / vialter


! style="background%3A%23c0e4c0" |(che) lor


|-

! style="background%3A%23c0e4c0%3Bheight%3A3em" |present


|<span class="Latn" lang="lmo">[[bàii#Lombard|bàii]]</span>


|<span class="Latn" lang="lmo">[[bàiet#Lombard|bàiet]]</span>


|<span class="Latn" lang="lmo">[[bàia#Lombard|bàia]]</span>


|<span class="Latn" lang="lmo">[[bàiom#Lombard|bàiom]]</span>


|<span class="Latn" lang="lmo">[[bàiov#Lombard|bàiov]], [[baiii#Lombard|baiii]]</span>


|<span class="Latn" lang="lmo">[[bàien#Lombard|bàien]]</span>


|-

! style="background%3A%23c0e4c0%3Bheight%3A3em" |past


|<span class="Latn" lang="lmo">[[baiàssi#Lombard|baiàssi]]</span>


|<span class="Latn" lang="lmo">[[baiàsset#Lombard|baiàsset]]</span>


|<span class="Latn" lang="lmo">[[baiàss#Lombard|baiàss]]</span>


|<span class="Latn" lang="lmo">[[baiàssom#Lombard|baiàssom]]</span>


|<span class="Latn" lang="lmo">[[baiàssov#Lombard|baiàssov]]</span>


|<span class="Latn" lang="lmo">[[baiàssen#Lombard|baiàssen]]</span>


|-

! colspan="2" rowspan="2" style="background%3A%23e4d4c0" |imperative


! style="background%3A%23e4d4c0" |–


! style="background%3A%23e4d4c0" |<del>tì</del>


! style="background%3A%23e4d4c0" |<del>lù / lee</del><br>che el


! style="background%3A%23e4d4c0" |<del>nun</del>


! style="background%3A%23e4d4c0" |<del>violter / vialter</del>


! style="background%3A%23e4d4c0" |<del>lor</del><br>che el


|-

|–


|<span class="Latn" lang="lmo">[[bàia#Lombard|bàia]]</span>


|<span class="Latn" lang="lmo">[[bàia#Lombard|bàia]]</span>


|<span class="Latn" lang="lmo">[[baièmm#Lombard|baièmm]]</span>


|<span class="Latn" lang="lmo">[[baiee#Lombard|baiee]]</span>


|<span class="Latn" lang="lmo">[[bàien#Lombard|bàien]]</span>


|}
</div></div><div class="NavFrame" style="text-align%3Acenter"><div class="NavHead">[[File:Flag of Bergamo.svg|20px]]&nbsp;&nbsp;Eastern Lombard conjugation of baià
 ([[:Category:Lombard transitive verbs|transitive]])</div><div class="NavContent">

{| style="text-align%3Acenter%3Bbackground%3A%23F9F9F9"

|-

! colspan="3" style="background%3A%23e2e4c0" |infinitive


| colspan="7" |<span class="Latn" lang="lmo">[[baià#Lombard|baià]]</span>


|-

! colspan="3" style="background%3A%23e2e4c0" |past participle


| colspan="7" |<span class="Latn" lang="lmo">[[baiàt#Lombard|baiàt]]</span>


|-

! colspan="3" style="background%3A%23e2e4c0" |auxiliary verb


| colspan="7" |<span class="Latn" lang="lmo">[[ìga#Lombard|ìga]]</span>


|-

! rowspan="2" colspan="2" style="background%3A%23DEDEDE" |


! colspan="3" style="background%3A%23DEDEDE" |singular


! colspan="3" style="background%3A%23DEDEDE" |plural


|-

! style="background%3A%23DEDEDE" |first


! style="background%3A%23DEDEDE" |second


! style="background%3A%23DEDEDE" |third


! style="background%3A%23DEDEDE" |first


! style="background%3A%23DEDEDE" |second


! style="background%3A%23DEDEDE" |third


|-

! rowspan="4" style="background%3A%23c0cfe4" |indicative


! style="background%3A%23c0cfe4" |


! style="background%3A%23c0cfe4" |mé


! style="background%3A%23c0cfe4" |té


! style="background%3A%23c0cfe4" |lü / le


! style="background%3A%23c0cfe4" |nóter


! style="background%3A%23c0cfe4" |vóter


! style="background%3A%23c0cfe4" |lur / lùre


|-

! style="background%3A%23c0cfe4%3Bheight%3A3em" |present


|<span class="Latn" lang="lmo">[[bàie#Lombard|bàie]]</span>


|<span class="Latn" lang="lmo">[[bàiet#Lombard|bàiet]]</span>


|<span class="Latn" lang="lmo">[[bàia#Lombard|bàia]]</span>


|<span class="Latn" lang="lmo">[[baióm#Lombard|baióm]]</span>


|<span class="Latn" lang="lmo">[[baiìf#Lombard|baiìf]]</span>


|<span class="Latn" lang="lmo">[[bàia#Lombard|bàia]]</span>


|-

! style="background%3A%23c0cfe4%3Bheight%3A3em" |imperfect


|<span class="Latn" lang="lmo">[[baiàe#Lombard|baiàe]]</span>


|<span class="Latn" lang="lmo">[[baiàet#Lombard|baiàet]]</span>


|<span class="Latn" lang="lmo">[[baiàa#Lombard|baiàa]]</span>


|<span class="Latn" lang="lmo">[[baiàem#Lombard|baiàem]]</span>


|<span class="Latn" lang="lmo">[[baiàef#Lombard|baiàef]]</span>


|<span class="Latn" lang="lmo">[[baiàa#Lombard|baiàa]]</span>


|-

! style="background%3A%23c0cfe4%3Bheight%3A3em" |future


|<span class="Latn" lang="lmo">[[baiaró#Lombard|baiaró]]</span>


|<span class="Latn" lang="lmo">[[baiarét#Lombard|baiarét]]</span>


|<span class="Latn" lang="lmo">[[baiarà#Lombard|baiarà]]</span>


|<span class="Latn" lang="lmo">[[baiaróm#Lombard|baiaróm]]</span>


|<span class="Latn" lang="lmo">[[baiarìf#Lombard|baiarìf]]</span>


|<span class="Latn" lang="lmo">[[baiarà#Lombard|baiarà]]</span>


|-

! rowspan="2" style="background%3A%23c0d8e4" |conditional


! style="background%3A%23c0d8e4" |


! style="background%3A%23c0d8e4" |mé


! style="background%3A%23c0d8e4" |té


! style="background%3A%23c0d8e4" |lü / lé


! style="background%3A%23c0d8e4" |nóter


! style="background%3A%23c0d8e4" |vóter


! style="background%3A%23c0d8e4" |lur / lúre


|-

! style="background%3A%23c0d8e4%3Bheight%3A3em" |present


|<span class="Latn" lang="lmo">[[baiarèse#Lombard|baiarèse]]</span>


|<span class="Latn" lang="lmo">[[baiarèset#Lombard|baiarèset]]</span>


|<span class="Latn" lang="lmo">[[baiarès#Lombard|baiarès]]</span>


|<span class="Latn" lang="lmo">[[baiarèsem#Lombard|baiarèsem]]</span>


|<span class="Latn" lang="lmo">[[baiarèsef#Lombard|baiarèsef]]</span>


|<span class="Latn" lang="lmo">[[baiarès#Lombard|baiarès]]</span>


|-

! rowspan="3" style="background%3A%23c0e4c0" |subjunctive


! style="background%3A%23c0e4c0" |


! style="background%3A%23c0e4c0" |(che) mé


! style="background%3A%23c0e4c0" |(che) té


! style="background%3A%23c0e4c0" |(che) lü / lé


! style="background%3A%23c0e4c0" |(che) nóter


! style="background%3A%23c0e4c0" |(che) vóter


! style="background%3A%23c0e4c0" |(che) lur / lùre


|-

! style="background%3A%23c0e4c0%3Bheight%3A3em" |present


|<span class="Latn" lang="lmo">[[bàies#Lombard|bàies]]</span>


|<span class="Latn" lang="lmo">[[bàies#Lombard|bàies]]</span>


|<span class="Latn" lang="lmo">[[bàie#Lombard|bàie]]</span>


|<span class="Latn" lang="lmo">[[baiómes#Lombard|baiómes]]</span>


|<span class="Latn" lang="lmo">[[baiìghes#Lombard|baiìghes]]</span>


|<span class="Latn" lang="lmo">[[bàie#Lombard|bàie]]</span>


|-

! style="background%3A%23c0e4c0%3Bheight%3A3em" |past


|<span class="Latn" lang="lmo">[[baièse#Lombard|baièse]]</span>


|<span class="Latn" lang="lmo">[[baièset#Lombard|baièset]]</span>


|<span class="Latn" lang="lmo">[[baiès#Lombard|baiès]]</span>


|<span class="Latn" lang="lmo">[[baièsem#Lombard|baièsem]]</span>


|<span class="Latn" lang="lmo">[[baièsef#Lombard|baièsef]]</span>


|<span class="Latn" lang="lmo">[[baiès#Lombard|baiès]]</span>


|-

! colspan="2" style="background%3A%23e4d4c0" |imperative


! style="background%3A%23e4d4c0" |–


! style="background%3A%23e4d4c0" |<del>té</del>


! style="background%3A%23e4d4c0" |–


! style="background%3A%23e4d4c0" |<del>nóter</del>


! style="background%3A%23e4d4c0" |<del>vóter</del>


! style="background%3A%23e4d4c0" |–


|-

| colspan="2" style="background%3A%23e4d4c0" |


|–


|<span class="Latn" lang="lmo">[[bàia#Lombard|bàia]]</span>


|–


|<span class="Latn" lang="lmo">[[baiómm#Lombard|baiómm]]</span>


|<span class="Latn" lang="lmo">[[baiì#Lombard|baiì]]</span>


|–


|}
</div></div>
""")
        expected = {
            "forms": [{
                "form": "Western-Lombard transitive",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form": "baià",
                "source": "Conjugation",
                "tags": ["infinitive"]
            }, {
                "form": "baiànd",
                "source": "Conjugation",
                "tags": ["gerund"]
            }, {
                "form": "baiàndo",
                "source": "Conjugation",
                "tags": ["gerund"]
            }, {
                "form": "baiàa",
                "source": "Conjugation",
                "tags": ["participle", "past"]
            }, {
                "form": "avè",
                "source": "Conjugation",
                "tags": ["auxiliary"]
            }, {
                "form":
                "bàii",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "present", "singular"]
            }, {
                "form":
                "bàiet",
                "source":
                "Conjugation",
                "tags": ["indicative", "present", "second-person", "singular"]
            }, {
                "form":
                "bàia",
                "source":
                "Conjugation",
                "tags": ["indicative", "present", "singular", "third-person"]
            }, {
                "form":
                "bàiom",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "plural", "present"]
            }, {
                "form":
                "bàiov",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "second-person"]
            }, {
                "form":
                "baiee",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "second-person"]
            }, {
                "form":
                "bàien",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "third-person"]
            }, {
                "form":
                "baiàvi",
                "source":
                "Conjugation",
                "tags":
                ["first-person", "imperfect", "indicative", "singular"]
            }, {
                "form":
                "baiàvet",
                "source":
                "Conjugation",
                "tags":
                ["imperfect", "indicative", "second-person", "singular"]
            }, {
                "form":
                "baiàva",
                "source":
                "Conjugation",
                "tags":
                ["imperfect", "indicative", "singular", "third-person"]
            }, {
                "form":
                "baiàvom",
                "source":
                "Conjugation",
                "tags": ["first-person", "imperfect", "indicative", "plural"]
            }, {
                "form":
                "baiàvov",
                "source":
                "Conjugation",
                "tags": ["imperfect", "indicative", "plural", "second-person"]
            }, {
                "form":
                "baiàven",
                "source":
                "Conjugation",
                "tags": ["imperfect", "indicative", "plural", "third-person"]
            }, {
                "form":
                "baiaróo",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "indicative", "singular"]
            }, {
                "form":
                "baiaré",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "second-person", "singular"]
            }, {
                "form":
                "baiarét",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "second-person", "singular"]
            }, {
                "form":
                "baiarà",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "singular", "third-person"]
            }, {
                "form":
                "baiarèmm",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "indicative", "plural"]
            }, {
                "form":
                "baiarii",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "plural", "second-person"]
            }, {
                "form":
                "baiarànn",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "plural", "third-person"]
            }, {
                "form":
                "baiarìa",
                "source":
                "Conjugation",
                "tags": ["conditional", "first-person", "present", "singular"]
            }, {
                "form":
                "baiarìss",
                "source":
                "Conjugation",
                "tags": ["conditional", "first-person", "present", "singular"]
            }, {
                "form":
                "baiarìssi",
                "source":
                "Conjugation",
                "tags": ["conditional", "first-person", "present", "singular"]
            }, {
                "form":
                "baiarìet",
                "source":
                "Conjugation",
                "tags":
                ["conditional", "present", "second-person", "singular"]
            }, {
                "form":
                "baiarìsset",
                "source":
                "Conjugation",
                "tags":
                ["conditional", "present", "second-person", "singular"]
            }, {
                "form":
                "baiarìa",
                "source":
                "Conjugation",
                "tags": ["conditional", "present", "singular", "third-person"]
            }, {
                "form":
                "baiarìss",
                "source":
                "Conjugation",
                "tags": ["conditional", "present", "singular", "third-person"]
            }, {
                "form":
                "baiarìom",
                "source":
                "Conjugation",
                "tags": ["conditional", "first-person", "plural", "present"]
            }, {
                "form":
                "baiarìssom",
                "source":
                "Conjugation",
                "tags": ["conditional", "first-person", "plural", "present"]
            }, {
                "form":
                "baiarìov",
                "source":
                "Conjugation",
                "tags": ["conditional", "plural", "present", "second-person"]
            }, {
                "form":
                "baiarìssov",
                "source":
                "Conjugation",
                "tags": ["conditional", "plural", "present", "second-person"]
            }, {
                "form":
                "baiarìen",
                "source":
                "Conjugation",
                "tags": ["conditional", "plural", "present", "third-person"]
            }, {
                "form":
                "baiarìssen",
                "source":
                "Conjugation",
                "tags": ["conditional", "plural", "present", "third-person"]
            }, {
                "form":
                "bàii",
                "source":
                "Conjugation",
                "tags": ["first-person", "present", "singular", "subjunctive"]
            }, {
                "form":
                "bàiet",
                "source":
                "Conjugation",
                "tags":
                ["present", "second-person", "singular", "subjunctive"]
            }, {
                "form":
                "bàia",
                "source":
                "Conjugation",
                "tags": ["present", "singular", "subjunctive", "third-person"]
            }, {
                "form":
                "bàiom",
                "source":
                "Conjugation",
                "tags": ["first-person", "plural", "present", "subjunctive"]
            }, {
                "form":
                "bàiov",
                "source":
                "Conjugation",
                "tags": ["plural", "present", "second-person", "subjunctive"]
            }, {
                "form":
                "baiii",
                "source":
                "Conjugation",
                "tags": ["plural", "present", "second-person", "subjunctive"]
            }, {
                "form":
                "bàien",
                "source":
                "Conjugation",
                "tags": ["plural", "present", "subjunctive", "third-person"]
            }, {
                "form":
                "baiàssi",
                "source":
                "Conjugation",
                "tags": ["first-person", "past", "singular", "subjunctive"]
            }, {
                "form":
                "baiàsset",
                "source":
                "Conjugation",
                "tags": ["past", "second-person", "singular", "subjunctive"]
            }, {
                "form":
                "baiàss",
                "source":
                "Conjugation",
                "tags": ["past", "singular", "subjunctive", "third-person"]
            }, {
                "form": "baiàssom",
                "source": "Conjugation",
                "tags": ["first-person", "past", "plural", "subjunctive"]
            }, {
                "form":
                "baiàssov",
                "source":
                "Conjugation",
                "tags": ["past", "plural", "second-person", "subjunctive"]
            }, {
                "form": "baiàssen",
                "source": "Conjugation",
                "tags": ["past", "plural", "subjunctive", "third-person"]
            }, {
                "form": "bàia",
                "source": "Conjugation",
                "tags": ["imperative", "second-person", "singular"]
            }, {
                "form": "bàia",
                "source": "Conjugation",
                "tags": ["imperative", "singular", "third-person"]
            }, {
                "form": "baièmm",
                "source": "Conjugation",
                "tags": ["first-person", "imperative", "plural"]
            }, {
                "form": "baiee",
                "source": "Conjugation",
                "tags": ["imperative", "plural", "second-person"]
            }, {
                "form": "bàien",
                "source": "Conjugation",
                "tags": ["imperative", "plural", "third-person"]
            }, {
                "form": "Eastern-Lombard transitive",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form": "baià",
                "source": "Conjugation",
                "tags": ["infinitive"]
            }, {
                "form": "baiàt",
                "source": "Conjugation",
                "tags": ["participle", "past"]
            }, {
                "form": "ìga",
                "source": "Conjugation",
                "tags": ["auxiliary"]
            }, {
                "form":
                "bàie",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "present", "singular"]
            }, {
                "form":
                "bàiet",
                "source":
                "Conjugation",
                "tags": ["indicative", "present", "second-person", "singular"]
            }, {
                "form":
                "bàia",
                "source":
                "Conjugation",
                "tags": ["indicative", "present", "singular", "third-person"]
            }, {
                "form":
                "baióm",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "plural", "present"]
            }, {
                "form":
                "baiìf",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "second-person"]
            }, {
                "form":
                "bàia",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "third-person"]
            }, {
                "form":
                "baiàe",
                "source":
                "Conjugation",
                "tags":
                ["first-person", "imperfect", "indicative", "singular"]
            }, {
                "form":
                "baiàet",
                "source":
                "Conjugation",
                "tags":
                ["imperfect", "indicative", "second-person", "singular"]
            }, {
                "form":
                "baiàa",
                "source":
                "Conjugation",
                "tags":
                ["imperfect", "indicative", "singular", "third-person"]
            }, {
                "form":
                "baiàem",
                "source":
                "Conjugation",
                "tags": ["first-person", "imperfect", "indicative", "plural"]
            }, {
                "form":
                "baiàef",
                "source":
                "Conjugation",
                "tags": ["imperfect", "indicative", "plural", "second-person"]
            }, {
                "form":
                "baiàa",
                "source":
                "Conjugation",
                "tags": ["imperfect", "indicative", "plural", "third-person"]
            }, {
                "form":
                "baiaró",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "indicative", "singular"]
            }, {
                "form":
                "baiarét",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "second-person", "singular"]
            }, {
                "form":
                "baiarà",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "singular", "third-person"]
            }, {
                "form":
                "baiaróm",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "indicative", "plural"]
            }, {
                "form":
                "baiarìf",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "plural", "second-person"]
            }, {
                "form":
                "baiarà",
                "source":
                "Conjugation",
                "tags": ["future", "indicative", "plural", "third-person"]
            }, {
                "form":
                "baiarèse",
                "source":
                "Conjugation",
                "tags": ["conditional", "first-person", "present", "singular"]
            }, {
                "form":
                "baiarèset",
                "source":
                "Conjugation",
                "tags":
                ["conditional", "present", "second-person", "singular"]
            }, {
                "form":
                "baiarès",
                "source":
                "Conjugation",
                "tags": ["conditional", "present", "singular", "third-person"]
            }, {
                "form":
                "baiarèsem",
                "source":
                "Conjugation",
                "tags": ["conditional", "first-person", "plural", "present"]
            }, {
                "form":
                "baiarèsef",
                "source":
                "Conjugation",
                "tags": ["conditional", "plural", "present", "second-person"]
            }, {
                "form":
                "baiarès",
                "source":
                "Conjugation",
                "tags": ["conditional", "plural", "present", "third-person"]
            }, {
                "form":
                "bàies",
                "source":
                "Conjugation",
                "tags": ["first-person", "present", "singular", "subjunctive"]
            }, {
                "form":
                "bàies",
                "source":
                "Conjugation",
                "tags":
                ["present", "second-person", "singular", "subjunctive"]
            }, {
                "form":
                "bàie",
                "source":
                "Conjugation",
                "tags": ["present", "singular", "subjunctive", "third-person"]
            }, {
                "form":
                "baiómes",
                "source":
                "Conjugation",
                "tags": ["first-person", "plural", "present", "subjunctive"]
            }, {
                "form":
                "baiìghes",
                "source":
                "Conjugation",
                "tags": ["plural", "present", "second-person", "subjunctive"]
            }, {
                "form":
                "bàie",
                "source":
                "Conjugation",
                "tags": ["plural", "present", "subjunctive", "third-person"]
            }, {
                "form":
                "baièse",
                "source":
                "Conjugation",
                "tags": ["first-person", "past", "singular", "subjunctive"]
            }, {
                "form":
                "baièset",
                "source":
                "Conjugation",
                "tags": ["past", "second-person", "singular", "subjunctive"]
            }, {
                "form":
                "baiès",
                "source":
                "Conjugation",
                "tags": ["past", "singular", "subjunctive", "third-person"]
            }, {
                "form": "baièsem",
                "source": "Conjugation",
                "tags": ["first-person", "past", "plural", "subjunctive"]
            }, {
                "form":
                "baièsef",
                "source":
                "Conjugation",
                "tags": ["past", "plural", "second-person", "subjunctive"]
            }, {
                "form": "baiès",
                "source": "Conjugation",
                "tags": ["past", "plural", "subjunctive", "third-person"]
            }, {
                "form": "bàia",
                "source": "Conjugation",
                "tags": ["imperative", "second-person", "singular"]
            }, {
                "form": "baiómm",
                "source": "Conjugation",
                "tags": ["first-person", "imperative", "plural"]
            }, {
                "form": "baiì",
                "source": "Conjugation",
                "tags": ["imperative", "plural", "second-person"]
            }],
        }
        self.assertEqual(expected, ret)
class InflTests(unittest.TestCase):
    def setUp(self):
        self.maxDiff = 100000
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def xinfl(self, word, lang, pos, section, text):
        """Runs a single inflection table parsing test, and returns ``data``."""
        self.ctx.start_page(word)
        self.ctx.start_section(lang)
        self.ctx.start_subsection(pos)
        tree = self.ctx.parse(text)
        data = {}
        parse_inflection_section(self.config, self.ctx, data, word, lang, pos,
                                 section, tree)
        return data

    def test_Swedish_noun1(self):
        ret = self.xinfl(
            "berg", "Swedish", "noun", "Declension", """
{| class="inflection-table+vsSwitcher" data-toggle-category="inflection" style="border%3A+solid+1px+%23CCCCFF%3B+text-align%3Aleft%3B" cellspacing="1" cellpadding="2"

|- style="background%3A+%23CCCCFF%3B+vertical-align%3A+top%3B"

! class="vsToggleElement" colspan="5" | Declension of <i class="Latn+mention" lang="sv">berg</i>&nbsp;


|- class="vsHide" style="background%3A+%23CCCCFF%3B"

! rowspan="2" style="min-width%3A+12em%3B" |


! colspan="2" | Singular


! colspan="2" | Plural


|- class="vsHide" style="background%3A+%23CCCCFF%3B"

! style="min-width%3A+12em%3B" | Indefinite


! style="min-width%3A+12em%3B" | Definite


! style="min-width%3A+12em%3B" | Indefinite


! style="min-width%3A+12em%3B" | Definite


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Nominative


| <span class="Latn" lang="sv">[[berg#Swedish|berg]]</span>


| <span class="Latn" lang="sv">[[berget#Swedish|berget]]</span>


| <span class="Latn" lang="sv">[[berg#Swedish|berg]]</span>


| <span class="Latn" lang="sv">[[bergen#Swedish|bergen]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Genitive


| <span class="Latn" lang="sv">[[bergs#Swedish|bergs]]</span>


| <span class="Latn" lang="sv">[[bergets#Swedish|bergets]]</span>


| <span class="Latn" lang="sv">[[bergs#Swedish|bergs]]</span>


| <span class="Latn" lang="sv">[[bergens#Swedish|bergens]]</span>


|}
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form": "berg",
                "source": "Declension",
                "tags": ["indefinite", "nominative", "singular"]
            }, {
                "form": "berget",
                "source": "Declension",
                "tags": ["definite", "nominative", "singular"]
            }, {
                "form": "berg",
                "source": "Declension",
                "tags": ["indefinite", "nominative", "plural"]
            }, {
                "form": "bergen",
                "source": "Declension",
                "tags": ["definite", "nominative", "plural"]
            }, {
                "form": "bergs",
                "source": "Declension",
                "tags": ["genitive", "indefinite", "singular"]
            }, {
                "form": "bergets",
                "source": "Declension",
                "tags": ["definite", "genitive", "singular"]
            }, {
                "form": "bergs",
                "source": "Declension",
                "tags": ["genitive", "indefinite", "plural"]
            }, {
                "form": "bergens",
                "source": "Declension",
                "tags": ["definite", "genitive", "plural"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Swedish_verb1(self):
        ret = self.xinfl(
            "kunna", "Swedish", "verb", "Conjugation", """
<div class="NavFrame" style="width%3A+54em%3B" data-toggle-category="inflection">
<div class="NavHead">Conjugation of kunna (irregular)</div>
<div class="NavContent">

{| class="inflection-table" style="width%3A+100%25%3B+line-height%3A+125%25%3B+background-color%3A+%23F9F9F9%3B+text-align%3A+center%3B+border%3A+1px+solid+%23CCCCFF%3B" cellpadding="3" cellspacing="1"

|-

!


! colspan="2" style="width%3A+50%25%3B+background-color%3A%23EFEFEF%3B" | Active


! colspan="2" style="width%3A+50%25%3B+background-color%3A%23EFEFEF%3B" | Passive


|-

! style="background-color%3A%23EFEFEF%3B" | Infinitive


| colspan="2" | <span class="Latn" lang="sv">[[kunna#Swedish|kunna]]</span>


| colspan="2" | &mdash;


|-

! style="background-color%3A%23EFEFEF%3B" | Supine


| colspan="2" | <span class="Latn" lang="sv">[[kunnat#Swedish|kunnat]]</span>


| colspan="2" | &mdash;


|-

! style="background-color%3A%23EFEFEF%3B" | Imperative


| colspan="2" | &mdash;


| colspan="2" | &mdash;


|-

! style="background-color%3A%23EFEFEF%3B" | ''Imper. plural''<sup>1</sup>


| colspan="2" | &mdash;


| colspan="2" | &mdash;


|-

!


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Present


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Past


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Present


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Past


|-

! style="background-color%3A%23EFEFEF%3B" | Indicative


| <span class="Latn" lang="sv">[[kan#Swedish|kan]]</span>


| <span class="Latn" lang="sv">[[kunde#Swedish|kunde]]</span>


| &mdash;


| &mdash;


|-

! style="background-color%3A%23EFEFEF%3B" | ''Ind. plural''<sup>1</sup>


| <span class="Latn" lang="sv">[[kunna#Swedish|kunna]]</span>


| <span class="Latn" lang="sv">[[kunde#Swedish|kunde]]</span>


| &mdash;


| &mdash;


|-

! style="background-color%3A%23EFEFEF%3B" | ''Subjunctive''<sup>2</sup>


| <span class="Latn" lang="sv">[[kunne#Swedish|kunne]]</span>


| <span class="Latn" lang="sv">[[kunde#Swedish|kunde]]</span>


| &mdash;


| &mdash;


|-

!


! colspan="4" style="width%3A+100%25%3B+background-color%3A%23EFEFEF%3B" | Participles


|-

! style="background-color%3A%23EFEFEF%3B" | Present&nbsp;participle


| colspan="4" | <span class="Latn" lang="sv">[[kunnande#Swedish|kunnande]]</span>


|-

! style="background-color%3A%23EFEFEF%3B" | Past&nbsp;participle


| colspan="4" | &mdash;


|-

| colspan="5" style="text-align%3A+left%3B" | <small><sup>1</sup> Archaic. <sup>2</sup> Dated. See [[Appendix:Swedish verbs#Dated and archaic forms|the appendix on Swedish verbs]].</small>


|}
</div></div>[[Category:Swedish irregular verbs|KUNNA]]
""")
        expected = {
            "forms": [{
                "form": "irregular",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form": "kunna",
                "source": "Conjugation",
                "tags": ["active", "infinitive"]
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['infinitive', 'passive']
            }, {
                "form": "kunnat",
                "source": "Conjugation",
                "tags": ["active", "supine"]
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['passive', 'supine']
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['active', 'imperative']
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['imperative', 'passive']
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['active', 'archaic', 'imperative', 'plural']
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['archaic', 'imperative', 'passive', 'plural']
            }, {
                "form": "kan",
                "source": "Conjugation",
                "tags": ["active", "indicative", "present"]
            }, {
                "form": "kunde",
                "source": "Conjugation",
                "tags": ["active", "indicative", "past"]
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['indicative', 'passive', 'present']
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['indicative', 'passive', 'past']
            }, {
                "form":
                "kunna",
                "source":
                "Conjugation",
                "tags":
                ["active", "archaic", "indicative", "plural", "present"]
            }, {
                "form":
                "kunde",
                "source":
                "Conjugation",
                "tags": ["active", "archaic", "indicative", "past", "plural"]
            }, {
                'form':
                '-',
                'source':
                'Conjugation',
                'tags':
                ['archaic', 'indicative', 'passive', 'plural', 'present']
            }, {
                'form':
                '-',
                'source':
                'Conjugation',
                'tags': ['archaic', 'indicative', 'passive', 'past', 'plural']
            }, {
                "form": "kunne",
                "source": "Conjugation",
                "tags": ["active", "dated", "present", "subjunctive"]
            }, {
                "form": "kunde",
                "source": "Conjugation",
                "tags": ["active", "dated", "past", "subjunctive"]
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['dated', 'passive', 'present', 'subjunctive']
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['dated', 'passive', 'past', 'subjunctive']
            }, {
                "form": "kunnande",
                "source": "Conjugation",
                "tags": ["participle", "present"]
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['participle', 'past']
            }],
        }
        self.assertEqual(expected, ret)

    def test_Swedish_verb2(self):
        ret = self.xinfl(
            "simma", "Swedish", "verb", "Conjugation", """
<div class="NavFrame" style="width%3A+54em%3B" data-toggle-category="inflection">
<div class="NavHead">Conjugation of simma (weak)</div>
<div class="NavContent">

{| class="inflection-table" style="width%3A+100%25%3B+line-height%3A+125%25%3B+background-color%3A+%23F9F9F9%3B+text-align%3A+center%3B+border%3A+1px+solid+%23CCCCFF%3B" cellpadding="3" cellspacing="1"

|-

!


! colspan="2" style="width%3A+50%25%3B+background-color%3A%23EFEFEF%3B" | Active


! colspan="2" style="width%3A+50%25%3B+background-color%3A%23EFEFEF%3B" | Passive


|-

! style="background-color%3A%23EFEFEF%3B" | Infinitive


| colspan="2" | <span class="Latn" lang="sv">[[simma#Swedish|simma]]</span>


| colspan="2" | <span class="Latn" lang="sv">[[simmas#Swedish|simmas]]</span>


|-

! style="background-color%3A%23EFEFEF%3B" | Supine


| colspan="2" | <span class="Latn" lang="sv">[[simmat#Swedish|simmat]]</span>


| colspan="2" | <span class="Latn" lang="sv">[[simmats#Swedish|simmats]]</span>


|-

! style="background-color%3A%23EFEFEF%3B" | Imperative


| colspan="2" | <span class="Latn" lang="sv">[[simma#Swedish|simma]]</span>


| colspan="2" | &mdash;


|-

! style="background-color%3A%23EFEFEF%3B" | ''Imper. plural''<sup>1</sup>


| colspan="2" | <span class="Latn" lang="sv">[[simmen#Swedish|simmen]]</span>


| colspan="2" | &mdash;


|-

!


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Present


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Past


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Present


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Past


|-

! style="background-color%3A%23EFEFEF%3B" | Indicative


| <span class="Latn" lang="sv">[[simmar#Swedish|simmar]]</span>


| <span class="Latn" lang="sv">[[simmade#Swedish|simmade]]</span>


| <span class="Latn" lang="sv">[[simmas#Swedish|simmas]]</span>


| <span class="Latn" lang="sv">[[simmades#Swedish|simmades]]</span>


|-

! style="background-color%3A%23EFEFEF%3B" | ''Ind. plural''<sup>1</sup>


| <span class="Latn" lang="sv">[[simma#Swedish|simma]]</span>


| <span class="Latn" lang="sv">[[simmade#Swedish|simmade]]</span>


| <span class="Latn" lang="sv">[[simmas#Swedish|simmas]]</span>


| <span class="Latn" lang="sv">[[simmades#Swedish|simmades]]</span>


|-

! style="background-color%3A%23EFEFEF%3B" | ''Subjunctive''<sup>2</sup>


| <span class="Latn" lang="sv">[[simme#Swedish|simme]]</span>


| <span class="Latn" lang="sv">[[simmade#Swedish|simmade]]</span>


| <span class="Latn" lang="sv">[[simmes#Swedish|simmes]]</span>


| <span class="Latn" lang="sv">[[simmades#Swedish|simmades]]</span>


|-

!


! colspan="4" style="width%3A+100%25%3B+background-color%3A%23EFEFEF%3B" | Participles


|-

! style="background-color%3A%23EFEFEF%3B" | Present&nbsp;participle


| colspan="4" | <span class="Latn" lang="sv">[[simmande#Swedish|simmande]]</span>


|-

! style="background-color%3A%23EFEFEF%3B" | Past&nbsp;participle


| colspan="4" | <span class="Latn" lang="sv">[[simmad#Swedish|simmad]]</span>


|-

| colspan="5" style="text-align%3A+left%3B" | <small><sup>1</sup> Archaic. <sup>2</sup> Dated. See [[Appendix:Swedish verbs#Dated and archaic forms|the appendix on Swedish verbs]].</small>


|}
</div></div>[[Category:Swedish weak verbs|SIMMA]]
<div class="NavFrame" style="width%3A+54em%3B" data-toggle-category="inflection">
<div class="NavHead">Conjugation of simma (class 3 strong)</div>
<div class="NavContent">

{| class="inflection-table" style="width%3A+100%25%3B+line-height%3A+125%25%3B+background-color%3A+%23F9F9F9%3B+text-align%3A+center%3B+border%3A+1px+solid+%23CCCCFF%3B" cellpadding="3" cellspacing="1"

|-

!


! colspan="2" style="width%3A+50%25%3B+background-color%3A%23EFEFEF%3B" | Active


! colspan="2" style="width%3A+50%25%3B+background-color%3A%23EFEFEF%3B" | Passive


|-

! style="background-color%3A%23EFEFEF%3B" | Infinitive


| colspan="2" | <span class="Latn" lang="sv">[[simma#Swedish|simma]]</span>


| colspan="2" | <span class="Latn" lang="sv">[[simmas#Swedish|simmas]]</span>


|-

! style="background-color%3A%23EFEFEF%3B" | Supine


| colspan="2" | <span class="Latn" lang="sv">[[summit#Swedish|summit]]</span>


| colspan="2" | <span class="Latn" lang="sv">[[summits#Swedish|summits]]</span>


|-

! style="background-color%3A%23EFEFEF%3B" | Imperative


| colspan="2" | <span class="Latn" lang="sv">[[sim#Swedish|sim]]</span>


| colspan="2" | &mdash;


|-

! style="background-color%3A%23EFEFEF%3B" | ''Imper. plural''<sup>1</sup>


| colspan="2" | <span class="Latn" lang="sv">[[simmen#Swedish|simmen]]</span>


| colspan="2" | &mdash;


|-

!


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Present


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Past


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Present


! style="width%3A+25%25%3B+background-color%3A%23EFEFEF%3B" | Past


|-

! style="background-color%3A%23EFEFEF%3B" | Indicative


| <span class="Latn" lang="sv">[[simmer#Swedish|simmer]]</span>


| <span class="Latn" lang="sv">[[sam#Swedish|sam]]</span>


| <span class="Latn" lang="sv">[[sims#Swedish|sims]]</span>, <span class="Latn" lang="sv">[[simmes#Swedish|simmes]]</span>


| <span class="Latn" lang="sv">[[sams#Swedish|sams]]</span>


|-

! style="background-color%3A%23EFEFEF%3B" | ''Ind. plural''<sup>1</sup>


| <span class="Latn" lang="sv">[[simma#Swedish|simma]]</span>


| <span class="Latn" lang="sv">[[summo#Swedish|summo]]</span>


| <span class="Latn" lang="sv">[[simmas#Swedish|simmas]]</span>


| <span class="Latn" lang="sv">[[summos#Swedish|summos]]</span>


|-

! style="background-color%3A%23EFEFEF%3B" | ''Subjunctive''<sup>2</sup>


| <span class="Latn" lang="sv">[[simme#Swedish|simme]]</span>


| <span class="Latn" lang="sv">[[summe#Swedish|summe]]</span>


| <span class="Latn" lang="sv">[[simmes#Swedish|simmes]]</span>


| <span class="Latn" lang="sv">[[summes#Swedish|summes]]</span>


|-

!


! colspan="4" style="width%3A+100%25%3B+background-color%3A%23EFEFEF%3B" | Participles


|-

! style="background-color%3A%23EFEFEF%3B" | Present&nbsp;participle


| colspan="4" | <span class="Latn" lang="sv">[[simmande#Swedish|simmande]]</span>


|-

! style="background-color%3A%23EFEFEF%3B" | Past&nbsp;participle


| colspan="4" | <span class="Latn" lang="sv">[[summen#Swedish|summen]]</span>


|-

| colspan="5" style="text-align%3A+left%3B" | <small><sup>1</sup> Archaic. <sup>2</sup> Dated. See [[Appendix:Swedish verbs#Dated and archaic forms|the appendix on Swedish verbs]].</small>


|}
</div></div>[[Category:Swedish strong verbs|SIMMA]][[Category:Swedish class 3 strong verbs|SIMMA]]
""")
        expected = {
            "forms": [{
                "form": "weak",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form": "simma",
                "source": "Conjugation",
                "tags": ["active", "infinitive"]
            }, {
                "form": "simmas",
                "source": "Conjugation",
                "tags": ["infinitive", "passive"]
            }, {
                "form": "simmat",
                "source": "Conjugation",
                "tags": ["active", "supine"]
            }, {
                "form": "simmats",
                "source": "Conjugation",
                "tags": ["passive", "supine"]
            }, {
                "form": "simma",
                "source": "Conjugation",
                "tags": ["active", "imperative"]
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['imperative', 'passive']
            }, {
                "form": "simmen",
                "source": "Conjugation",
                "tags": ["active", "archaic", "imperative", "plural"]
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['archaic', 'imperative', 'passive', 'plural']
            }, {
                "form": "simmar",
                "source": "Conjugation",
                "tags": ["active", "indicative", "present"]
            }, {
                "form": "simmade",
                "source": "Conjugation",
                "tags": ["active", "indicative", "past"]
            }, {
                "form": "simmas",
                "source": "Conjugation",
                "tags": ["indicative", "passive", "present"]
            }, {
                "form": "simmades",
                "source": "Conjugation",
                "tags": ["indicative", "passive", "past"]
            }, {
                "form":
                "simma",
                "source":
                "Conjugation",
                "tags":
                ["active", "archaic", "indicative", "plural", "present"]
            }, {
                "form":
                "simmade",
                "source":
                "Conjugation",
                "tags": ["active", "archaic", "indicative", "past", "plural"]
            }, {
                "form":
                "simmas",
                "source":
                "Conjugation",
                "tags":
                ["archaic", "indicative", "passive", "plural", "present"]
            }, {
                "form":
                "simmades",
                "source":
                "Conjugation",
                "tags": ["archaic", "indicative", "passive", "past", "plural"]
            }, {
                "form": "simme",
                "source": "Conjugation",
                "tags": ["active", "dated", "present", "subjunctive"]
            }, {
                "form": "simmade",
                "source": "Conjugation",
                "tags": ["active", "dated", "past", "subjunctive"]
            }, {
                "form": "simmes",
                "source": "Conjugation",
                "tags": ["dated", "passive", "present", "subjunctive"]
            }, {
                "form": "simmades",
                "source": "Conjugation",
                "tags": ["dated", "passive", "past", "subjunctive"]
            }, {
                "form": "simmande",
                "source": "Conjugation",
                "tags": ["participle", "present"]
            }, {
                "form": "simmad",
                "source": "Conjugation",
                "tags": ["participle", "past"]
            }, {
                "form": "strong",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form": "3 strong",
                "source": "Conjugation",
                "tags": ["class"]
            }, {
                "form": "simma",
                "source": "Conjugation",
                "tags": ["active", "infinitive"]
            }, {
                "form": "simmas",
                "source": "Conjugation",
                "tags": ["infinitive", "passive"]
            }, {
                "form": "summit",
                "source": "Conjugation",
                "tags": ["active", "supine"]
            }, {
                "form": "summits",
                "source": "Conjugation",
                "tags": ["passive", "supine"]
            }, {
                "form": "sim",
                "source": "Conjugation",
                "tags": ["active", "imperative"]
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['imperative', 'passive']
            }, {
                'form': 'simmen',
                'source': 'Conjugation',
                'tags': ['active', 'archaic', 'imperative', 'plural']
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['archaic', 'imperative', 'passive', 'plural']
            }, {
                "form": "simmer",
                "source": "Conjugation",
                "tags": ["active", "indicative", "present"]
            }, {
                "form": "sam",
                "source": "Conjugation",
                "tags": ["active", "indicative", "past"]
            }, {
                "form": "sims",
                "source": "Conjugation",
                "tags": ["indicative", "passive", "present"]
            }, {
                "form": "simmes",
                "source": "Conjugation",
                "tags": ["indicative", "passive", "present"]
            }, {
                "form": "sams",
                "source": "Conjugation",
                "tags": ["indicative", "passive", "past"]
            }, {
                'form':
                'simma',
                'source':
                'Conjugation',
                'tags':
                ['active', 'archaic', 'indicative', 'plural', 'present']
            }, {
                "form":
                "summo",
                "source":
                "Conjugation",
                "tags": ["active", "archaic", "indicative", "past", "plural"]
            }, {
                'form':
                'simmas',
                'source':
                'Conjugation',
                'tags':
                ['archaic', 'indicative', 'passive', 'plural', 'present']
            }, {
                "form":
                "summos",
                "source":
                "Conjugation",
                "tags": ["archaic", "indicative", "passive", "past", "plural"]
            }, {
                'form': 'simme',
                'source': 'Conjugation',
                'tags': ['active', 'dated', 'present', 'subjunctive']
            }, {
                "form": "summe",
                "source": "Conjugation",
                "tags": ["active", "dated", "past", "subjunctive"]
            }, {
                'form': 'simmes',
                'source': 'Conjugation',
                'tags': ['dated', 'passive', 'present', 'subjunctive']
            }, {
                "form": "summes",
                "source": "Conjugation",
                "tags": ["dated", "passive", "past", "subjunctive"]
            }, {
                'form': 'simmande',
                'source': 'Conjugation',
                'tags': ['participle', 'present']
            }, {
                "form": "summen",
                "source": "Conjugation",
                "tags": ["participle", "past"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Swedish_adj1(self):
        ret = self.xinfl(
            "vacker", "Swedish", "adj", "Declension", """
{| class="inflection-table+vsSwitcher" data-toggle-category="inflection" style="border%3A+solid+1px+%23CCCCFF%3B+text-align%3Aleft%3B" cellspacing="1" cellpadding="2"

|- style="background%3A+%23CCCCFF%3B+vertical-align%3A+top%3B"

! class="vsToggleElement" colspan="4" | Inflection of <i class="Latn+mention" lang="sv">vacker</i>


|- class="vsHide" style="background%3A+%23CCCCFF%3B"

! style="min-width%3A+12em%3B" | Indefinite


! style="min-width%3A+12em%3B" | Positive


! style="min-width%3A+12em%3B" | Comparative


! style="min-width%3A+12em%3B" | Superlative<sup>2</sup>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Common singular


| <span class="Latn" lang="sv">[[vacker#Swedish|vacker]]</span>


| <span class="Latn" lang="sv">[[vackrare#Swedish|vackrare]]</span>


| <span class="Latn" lang="sv">[[vackrast#Swedish|vackrast]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Neuter singular


| <span class="Latn" lang="sv">[[vackert#Swedish|vackert]]</span>


| <span class="Latn" lang="sv">[[vackrare#Swedish|vackrare]]</span>


| <span class="Latn" lang="sv">[[vackrast#Swedish|vackrast]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Plural


| <span class="Latn" lang="sv">[[vackra#Swedish|vackra]]</span>


| <span class="Latn" lang="sv">[[vackrare#Swedish|vackrare]]</span>


| <span class="Latn" lang="sv">[[vackrast#Swedish|vackrast]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Masculine plural<sup>3</sup>


| <span class="Latn" lang="sv">[[vackre#Swedish|vackre]]</span>


| <span class="Latn" lang="sv">[[vackrare#Swedish|vackrare]]</span>


| <span class="Latn" lang="sv">[[vackrast#Swedish|vackrast]]</span>


|- class="vsHide" style="background%3A+%23CCCCFF%3B"

! Definite


! Positive


! Comparative


! Superlative


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Masculine singular<sup>1</sup>


| <span class="Latn" lang="sv">[[vackre#Swedish|vackre]]</span>


| <span class="Latn" lang="sv">[[vackrare#Swedish|vackrare]]</span>


| <span class="Latn" lang="sv">[[vackraste#Swedish|vackraste]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | All


| <span class="Latn" lang="sv">[[vackra#Swedish|vackra]]</span>


| <span class="Latn" lang="sv">[[vackrare#Swedish|vackrare]]</span>


| <span class="Latn" lang="sv">[[vackraste#Swedish|vackraste]]</span>


|- class="vsHide" style="background%3A+%23E6E6FF%3B"

| style="font-size%3A+smaller%3B" colspan="4" | 1) Only used, optionally, to refer to things whose natural gender is masculine.<br>2) The indefinite superlative forms are only used in the predicative.<br>3) Dated or archaic


|}
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form":
                "vacker",
                "source":
                "Declension",
                "tags":
                ["common-gender", "indefinite", "positive", "singular"]
            }, {
                "form":
                "vackrare",
                "source":
                "Declension",
                "tags":
                ["common-gender", "comparative", "indefinite", "singular"]
            }, {
                "form":
                "vackrast",
                "source":
                "Declension",
                "tags":
                ["common-gender", "indefinite", "singular", "superlative"]
            }, {
                "form": "vackert",
                "source": "Declension",
                "tags": ["indefinite", "neuter", "positive", "singular"]
            }, {
                "form":
                "vackrare",
                "source":
                "Declension",
                "tags": ["comparative", "indefinite", "neuter", "singular"]
            }, {
                "form":
                "vackrast",
                "source":
                "Declension",
                "tags": ["indefinite", "neuter", "singular", "superlative"]
            }, {
                "form": "vackra",
                "source": "Declension",
                "tags": ["indefinite", "plural", "positive"]
            }, {
                "form": "vackrare",
                "source": "Declension",
                "tags": ["comparative", "indefinite", "plural"]
            }, {
                "form": "vackrast",
                "source": "Declension",
                "tags": ["indefinite", "plural", "superlative"]
            }, {
                "form": "vackre",
                "source": "Declension",
                "tags": ["indefinite", "masculine", "plural", "positive"]
            }, {
                "form":
                "vackrare",
                "source":
                "Declension",
                "tags": ["comparative", "indefinite", "masculine", "plural"]
            }, {
                "form":
                "vackrast",
                "source":
                "Declension",
                "tags": ["indefinite", "masculine", "plural", "superlative"]
            }, {
                "form": "vackre",
                "source": "Declension",
                "tags": ["definite", "masculine", "positive", "singular"]
            }, {
                "form":
                "vackrare",
                "source":
                "Declension",
                "tags": ["comparative", "definite", "masculine", "singular"]
            }, {
                "form":
                "vackraste",
                "source":
                "Declension",
                "tags": ["definite", "masculine", "singular", "superlative"]
            }, {
                "form": "vackra",
                "source": "Declension",
                "tags": ["definite", "positive"]
            }, {
                "form": "vackrare",
                "source": "Declension",
                "tags": ["comparative", "definite"]
            }, {
                "form": "vackraste",
                "source": "Declension",
                "tags": ["definite", "superlative"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Swedish_noun2(self):
        ret = self.xinfl(
            "mos", "Swedish", "noun", "Declension", """
{| class="inflection-table+vsSwitcher" data-toggle-category="inflection" style="border%3A+solid+1px+%23CCCCFF%3B+text-align%3Aleft%3B" cellspacing="1" cellpadding="2"

|- style="background%3A+%23CCCCFF%3B+vertical-align%3Atop%3B"

! class="vsToggleElement" colspan="5" | Declension of <i class="Latn+mention" lang="sv">[[mos#Swedish|mos]]</i>&nbsp;


|- class="vsHide" style="background%3A+%23CCCCFF%3B"

! rowspan="2" style="min-width%3A+12em%3B" |


! colspan="2" | Uncountable


! colspan="2" |


|- class="vsHide" style="background%3A+%23CCCCFF%3B"

! style="min-width%3A+12em%3B" | Indefinite


! style="min-width%3A+12em%3B" | Definite


! style="min-width%3A+12em%3B" |


! style="min-width%3A+12em%3B" |


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Nominative


| <span class="Latn+form-of+lang-sv+indef%7Cnom%7Cs-form-of+++++++" lang="sv">[[mos#Swedish|mos]]</span>


| <span class="Latn+form-of+lang-sv+def%7Cnom%7Cs-form-of+++++++" lang="sv">[[moset#Swedish|moset]]</span>


| &mdash;


| &mdash;


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Genitive


| <span class="Latn+form-of+lang-sv+indef%7Cgen%7Cs-form-of+++++++" lang="sv">[[mos#Swedish|mos]]</span>


| <span class="Latn+form-of+lang-sv+def%7Cgen%7Cs-form-of+++++++" lang="sv">[[mosets#Swedish|mosets]]</span>


| &mdash;


| &mdash;


|}
[[Category:Swedish nouns]]
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form": "mos",
                "source": "Declension",
                "tags": ["indefinite", "nominative", "uncountable"]
            }, {
                "form": "moset",
                "source": "Declension",
                "tags": ["definite", "nominative", "uncountable"]
            }, {
                "form": "mos",
                "source": "Declension",
                "tags": ["genitive", "indefinite", "uncountable"]
            }, {
                "form": "mosets",
                "source": "Declension",
                "tags": ["definite", "genitive", "uncountable"]
            }],
        }
        self.assertEqual(expected, ret)
class InflTests(unittest.TestCase):
    def setUp(self):
        self.maxDiff = 100000
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def xinfl(self, word, lang, pos, section, text):
        """Runs a single inflection table parsing test, and returns ``data``."""
        self.ctx.start_page(word)
        self.ctx.start_section(lang)
        self.ctx.start_subsection(pos)
        tree = self.ctx.parse(text)
        data = {}
        parse_inflection_section(self.config, self.ctx, data, word, lang, pos,
                                 section, tree)
        return data

    def test_Danish_noun1(self):
        ret = self.xinfl(
            "motorsav", "Danish", "noun", "Inflection", """
<div class="NavFrame">
<div class="NavHead">Declension of <i class="Latn+mention" lang="da">motorsav</i></div>
<div class="NavContent">

{| class="inflection-table" style="text-align%3Acenter%3Bwidth%3A100%25%3B"

|- style="background-color%3A%23eee%3B"

! rowspan="2" | common<br>gender


! colspan="2" | ''Singular''


! colspan="2" | ''Plural''


|- style="font-size%3A90%25%3Bbackground-color%3A%23eee%3B"

! style="width%3A25%25%3B" | ''indefinite''


! style="width%3A25%25%3B" | ''definite''


! style="width%3A25%25%3B" | ''indefinite''


! style="width%3A25%25%3B" | ''definite''


|-

! style="background-color%3A%23eee%3B" | ''[[nominative case|nominative]]''


| style="background-color%3A%23f9f9f9%3B" | <span class="Latn" lang="da">[[motorsav#Danish|motorsav]]</span>


| style="background-color%3A%23f9f9f9%3B" | <span class="Latn+form-of+lang-da+def%7Cs-form-of+++++++" lang="da">[[motorsaven#Danish|motorsaven]]</span>


| style="background-color%3A%23f9f9f9%3B" | <span class="Latn+form-of+lang-da+indef%7Cp-form-of+++++++" lang="da">[[motorsave#Danish|motorsave]]</span>


| style="background-color%3A%23f9f9f9%3B" | <span class="Latn+form-of+lang-da+def%7Cp-form-of+++++++" lang="da">[[motorsavene#Danish|motorsavene]]</span>


|-

! style="background-color%3A%23eee%3B" | ''[[genitive case|genitive]]''


| style="background-color%3A%23f9f9f9%3B" | <span class="Latn+form-of+lang-da+indef%7Cgen%7Cs-form-of+++++++" lang="da">[[motorsavs#Danish|motorsavs]]</span>


| style="background-color%3A%23f9f9f9%3B" | <span class="Latn+form-of+lang-da+def%7Cgen%7Cs-form-of+++++++" lang="da">[[motorsavens#Danish|motorsavens]]</span>


| style="background-color%3A%23f9f9f9%3B" | <span class="Latn+form-of+lang-da+indef%7Cgen%7Cp-form-of+++++++" lang="da">[[motorsaves#Danish|motorsaves]]</span>


| style="background-color%3A%23f9f9f9%3B" | <span class="Latn+form-of+lang-da+def%7Cgen%7Cp-form-of+++++++" lang="da">[[motorsavenes#Danish|motorsavenes]]</span>


|}

</div></div>
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Inflection",
                "tags": ["table-tags"]
            }, {
                "form": "motorsav",
                "source": "Inflection",
                "tags": ["indefinite", "nominative", "singular"]
            }, {
                "form": "motorsaven",
                "source": "Inflection",
                "tags": ["definite", "nominative", "singular"]
            }, {
                "form": "motorsave",
                "source": "Inflection",
                "tags": ["indefinite", "nominative", "plural"]
            }, {
                "form": "motorsavene",
                "source": "Inflection",
                "tags": ["definite", "nominative", "plural"]
            }, {
                "form": "motorsavs",
                "source": "Inflection",
                "tags": ["genitive", "indefinite", "singular"]
            }, {
                "form": "motorsavens",
                "source": "Inflection",
                "tags": ["definite", "genitive", "singular"]
            }, {
                "form": "motorsaves",
                "source": "Inflection",
                "tags": ["genitive", "indefinite", "plural"]
            }, {
                "form": "motorsavenes",
                "source": "Inflection",
                "tags": ["definite", "genitive", "plural"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Danish_verb1(self):
        ret = self.xinfl(
            "patte", "Danish", "verb", "Inflection", """
<div class="NavFrame">
<div class="NavHead">Inflection of <i class="Latn+mention" lang="da">patte</i></div>
<div class="NavContent">

{| class="inflection-table" style="border-collapse%3Aseparate%3B+background%3A%23F0F0F0%3B+text-align%3Acenter%3B+width%3A100%25%3B+border-spacing%3A2px"

|-

!


! colspan="1" |present


! colspan="1" |past


|-

! colspan="1" style="background%3A%23c0cfe4" | simple


|<span class="Latn+form-of+lang-da+pres-form-of+++++++" lang="da">[[patter#Danish|patter]]</span>


|<span class="Latn+form-of+lang-da+past-form-of+++++++" lang="da">[[pattede#Danish|pattede]]</span>


|-

! colspan="1" style="background%3A%23c0cfe4" | perfect


|<span class="Latn" lang="da">[[har#Danish|har]]</span> pattet


|<span class="Latn" lang="da">[[havde#Danish|havde]]</span> pattet


|-

! colspan="1" style="background%3A%23c0cfe4" | passive


|<span class="Latn+form-of+lang-da+pasv-form-of+++++++" lang="da">[[pattes#Danish|pattes]]</span>


|&mdash;


|-

! colspan="1" style="background%3A%23c0cfe4" | participle


|<span class="Latn+form-of+lang-da+pres%7Cptcp-form-of+++++++" lang="da">[[pattende#Danish|pattende]]</span>


|<span class="Latn+form-of+lang-da+past%7Cptcp-form-of+++++++" lang="da">[[pattet#Danish|pattet]]</span>


|-

! colspan="1" style="background%3A%23e2e4c0" |imperative


|<span class="Latn+form-of+lang-da+impr-form-of+++++++" lang="da">[[pat#Danish|pat]]</span>


|—


|-

! colspan="1" style="background%3A%23e2e4c0" |infinitive


|<span class="Latn" lang="da">[[patte#Danish|patte]]</span>


|—


|-

! colspan="1" style="background%3A%23e2e4c0" |auxiliary verb


|<span class="Latn" lang="da">[[have#Danish|have]]</span>


|—


|-

! colspan="1" style="background%3A%23e2e4c0" |gerund


|<span class="Latn+form-of+lang-da+gerund-form-of+++++++" lang="da">[[patten#Danish|patten]]</span>


|—


|}


</div></div>



""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Inflection",
                "tags": ["table-tags"]
            }, {
                "form": "patter",
                "source": "Inflection",
                "tags": ["present"]
            }, {
                "form": "pattede",
                "source": "Inflection",
                "tags": ["past"]
            }, {
                "form": "har pattet",
                "source": "Inflection",
                "tags": ["perfect", "present"]
            }, {
                "form": "havde pattet",
                "source": "Inflection",
                "tags": ["past", "perfect"]
            }, {
                "form": "pattes",
                "source": "Inflection",
                "tags": ["passive", "present"]
            }, {
                'form': '-',
                'source': 'Inflection',
                'tags': ['passive', 'past']
            }, {
                "form": "pattende",
                "source": "Inflection",
                "tags": ["participle", "present"]
            }, {
                "form": "pattet",
                "source": "Inflection",
                "tags": ["participle", "past"]
            }, {
                "form": "pat",
                "source": "Inflection",
                "tags": ["imperative", "present"]
            }, {
                'form': '-',
                'source': 'Inflection',
                'tags': ['imperative', 'past']
            }, {
                "form": "patte",
                "source": "Inflection",
                "tags": ["infinitive", "present"]
            }, {
                'form': '-',
                'source': 'Inflection',
                'tags': ['infinitive', 'past']
            }, {
                "form": "have",
                "source": "Inflection",
                "tags": ["auxiliary", "present"]
            }, {
                'form': '-',
                'source': 'Inflection',
                'tags': ['auxiliary', 'past']
            }, {
                "form": "patten",
                "source": "Inflection",
                "tags": ["gerund", "present"]
            }, {
                'form': '-',
                'source': 'Inflection',
                'tags': ['gerund', 'past']
            }],
        }
        self.assertEqual(expected, ret)

    def test_Danish_adj1(self):
        ret = self.xinfl(
            "kedelig", "Danish", "adj", "Inflection", """
{| class="inflection-table+vsSwitcher" data-toggle-category="inflection" style="border%3A+solid+1px+%23CCCCFF%3B+text-align%3Aleft%3B" cellspacing="1" cellpadding="2"

|- style="background%3A+%23CCCCFF%3B+vertical-align%3A+top%3B"

! class="vsToggleElement" colspan="4" | Inflection of <i class="Latn+mention" lang="da">kedelig</i>


|- class="vsHide" style="background%3A+%23CCCCFF%3B"

! style="min-width%3A+12em%3B" |


! style="min-width%3A+12em%3B" | Positive


! style="min-width%3A+12em%3B" | Comparative


! style="min-width%3A+12em%3B" | Superlative


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Common singular


| <span class="Latn" lang="da">[[kedelig#Danish|kedelig]]</span>


| <span class="Latn" lang="da">[[kedeligere#Danish|kedeligere]]</span>


| <span class="Latn" lang="da">[[kedeligst#Danish|kedeligst]]</span><sup>2</sup>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Neuter singular


| <span class="Latn" lang="da">[[kedeligt#Danish|kedeligt]]</span>


| <span class="Latn" lang="da">[[kedeligere#Danish|kedeligere]]</span>


| <span class="Latn" lang="da">[[kedeligst#Danish|kedeligst]]</span><sup>2</sup>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Plural


| <span class="Latn" lang="da">[[kedelige#Danish|kedelige]]</span>


| <span class="Latn" lang="da">[[kedeligere#Danish|kedeligere]]</span>


| <span class="Latn" lang="da">[[kedeligst#Danish|kedeligst]]</span><sup>2</sup>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Definite attributive<sup>1</sup>


| <span class="Latn" lang="da">[[kedelige#Danish|kedelige]]</span>


| <span class="Latn" lang="da">[[kedeligere#Danish|kedeligere]]</span>


| <span class="Latn" lang="da">[[kedeligste#Danish|kedeligste]]</span>


|- class="vsHide" style="background%3A+%23E6E6FF%3B"

| style="font-size%3A+smaller%3B" colspan="4" | 1) When an adjective is applied predicatively to something definite, the corresponding "indefinite" form is used.<br> 2) The "indefinite" superlatives may not be used attributively.


|}
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Inflection",
                "tags": ["table-tags"]
            }, {
                "form": "kedelig",
                "source": "Inflection",
                "tags": ["common-gender", "positive", "singular"]
            }, {
                "form": "kedeligere",
                "source": "Inflection",
                "tags": ["common-gender", "comparative", "singular"]
            }, {
                "form": "kedeligst",
                "source": "Inflection",
                "tags": ["common-gender", "singular", "superlative"]
            }, {
                "form": "kedeligt",
                "source": "Inflection",
                "tags": ["neuter", "positive", "singular"]
            }, {
                "form": "kedeligere",
                "source": "Inflection",
                "tags": ["comparative", "neuter", "singular"]
            }, {
                "form": "kedeligst",
                "source": "Inflection",
                "tags": ["neuter", "singular", "superlative"]
            }, {
                "form": "kedelige",
                "source": "Inflection",
                "tags": ["plural", "positive"]
            }, {
                "form": "kedeligere",
                "source": "Inflection",
                "tags": ["comparative", "plural"]
            }, {
                "form": "kedeligst",
                "source": "Inflection",
                "tags": ["plural", "superlative"]
            }, {
                "form": "kedelige",
                "source": "Inflection",
                "tags": ["attributive", "definite", "positive"]
            }, {
                "form": "kedeligere",
                "source": "Inflection",
                "tags": ["attributive", "comparative", "definite"]
            }, {
                "form": "kedeligste",
                "source": "Inflection",
                "tags": ["attributive", "definite", "superlative"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Danish_adj2(self):
        # This also tests having forms identical to a tag/header in the table
        ret = self.xinfl(
            "negativ", "Danish", "adj", "Inflection", """
{| class="inflection-table+vsSwitcher" data-toggle-category="inflection" style="border%3A+solid+1px+%23CCCCFF%3B+text-align%3Aleft%3B" cellspacing="1" cellpadding="2"

|- style="background%3A+%23CCCCFF%3B+vertical-align%3A+top%3B"

! class="vsToggleElement" colspan="4" | Inflection of <i class="Latn+mention" lang="da">negativ</i>


|- class="vsHide" style="background%3A+%23CCCCFF%3B"

! style="min-width%3A+12em%3B" |


! style="min-width%3A+12em%3B" | Positive


! style="min-width%3A+12em%3B" | Comparative


! style="min-width%3A+12em%3B" | Superlative


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Common singular


| <span class="Latn" lang="da">[[negativ#Danish|negativ]]</span>


| <span class="Latn" lang="da">[[mere#Danish|mere]] [[negativ#Danish|negativ]]</span>


| <span class="Latn" lang="da">[[mest#Danish|mest]] [[negativ#Danish|negativ]]</span><sup>2</sup>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Neuter singular


| <span class="Latn" lang="da">[[negativt#Danish|negativt]]</span>


| <span class="Latn" lang="da">[[mere#Danish|mere]] [[negativ#Danish|negativ]]</span>


| <span class="Latn" lang="da">[[mest#Danish|mest]] [[negativ#Danish|negativ]]</span><sup>2</sup>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Plural


| <span class="Latn" lang="da">[[negative#Danish|negative]]</span>


| <span class="Latn" lang="da">[[mere#Danish|mere]] [[negativ#Danish|negativ]]</span>


| <span class="Latn" lang="da">[[mest#Danish|mest]] [[negativ#Danish|negativ]]</span><sup>2</sup>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23E6E6FF%3B" | Definite attributive<sup>1</sup>


| <span class="Latn" lang="da">[[negative#Danish|negative]]</span>


| <span class="Latn" lang="da">[[mere#Danish|mere]] [[negativ#Danish|negativ]]</span>


| <span class="Latn" lang="da">[[mest#Danish|mest]] [[negative#Danish|negative]]</span>


|- class="vsHide" style="background%3A+%23E6E6FF%3B"

| style="font-size%3A+smaller%3B" colspan="4" | 1) When an adjective is applied predicatively to something definite, the corresponding "indefinite" form is used.<br> 2) The "indefinite" superlatives may not be used attributively.


|}
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Inflection",
                "tags": ["table-tags"]
            }, {
                "form": "negativ",
                "source": "Inflection",
                "tags": ["common-gender", "positive", "singular"]
            }, {
                "form": "mere negativ",
                "source": "Inflection",
                "tags": ["common-gender", "comparative", "singular"]
            }, {
                "form": "mest negativ",
                "source": "Inflection",
                "tags": ["common-gender", "singular", "superlative"]
            }, {
                "form": "negativt",
                "source": "Inflection",
                "tags": ["neuter", "positive", "singular"]
            }, {
                "form": "mere negativ",
                "source": "Inflection",
                "tags": ["comparative", "neuter", "singular"]
            }, {
                "form": "mest negativ",
                "source": "Inflection",
                "tags": ["neuter", "singular", "superlative"]
            }, {
                "form": "negative",
                "source": "Inflection",
                "tags": ["plural", "positive"]
            }, {
                "form": "mere negativ",
                "source": "Inflection",
                "tags": ["comparative", "plural"]
            }, {
                "form": "mest negativ",
                "source": "Inflection",
                "tags": ["plural", "superlative"]
            }, {
                "form": "negative",
                "source": "Inflection",
                "tags": ["attributive", "definite", "positive"]
            }, {
                "form": "mere negativ",
                "source": "Inflection",
                "tags": ["attributive", "comparative", "definite"]
            }, {
                "form": "mest negative",
                "source": "Inflection",
                "tags": ["attributive", "definite", "superlative"]
            }],
        }
        self.assertEqual(expected, ret)
示例#8
0
class InflTests(unittest.TestCase):
    def setUp(self):
        self.maxDiff = 100000
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def xinfl(self, word, lang, pos, section, text):
        """Runs a single inflection table parsing test, and returns ``data``."""
        self.ctx.start_page(word)
        self.ctx.start_section(lang)
        self.ctx.start_subsection(pos)
        tree = self.ctx.parse(text)
        data = {}
        parse_inflection_section(self.config, self.ctx, data, word, lang, pos,
                                 section, tree)
        return data

    def test_Dutch_verb1(self):
        ret = self.xinfl(
            "slapen", "Dutch", "verb", "Inflection", """
{| style="border%3A1px+solid+%23CCCCFF%3B+text-align%3Acenter%3B+line-height%3A125%25" class="inflection-table+vsSwitcher" data-toggle-category="inflection" cellspacing="1" cellpadding="3"

|- style="background%3A+%23CCCCFF%3B"

! colspan="5" class="vsToggleElement" style="text-align%3A+left" | Inflection of <i class="Latn+mention" lang="nl">slapen</i> (strong class 7)


|- class="vsShow" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[infinitive]]


| style="min-width%3A+12em%3B" | <span class="Latn" lang="nl">[[slapen#Dutch|slapen]]</span>


|- class="vsShow" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[past tense|past]]&nbsp;[[singular]]


| <span class="Latn" lang="nl">[[sliep#Dutch|sliep]]</span>


|- class="vsShow" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[past tense|past]]&nbsp;[[participle]]


| <span class="Latn" lang="nl">[[geslapen#Dutch|geslapen]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[infinitive]]


| colspan="4" | <span class="Latn" lang="nl">[[slapen#Dutch|slapen]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[gerund]]


| colspan="4" | <span class="Latn" lang="nl">[[slapen#Dutch|slapen]]</span> <span class="gender"><abbr title="neuter+gender">n</abbr></span>


|- class="vsHide" style="background%3A+%23E6E6FF%3B"

|


| style="min-width%3A+12em%3B+font-weight%3A+bold" | [[present&nbsp;tense]]


| style="min-width%3A+12em%3B+font-weight%3A+bold" | [[past&nbsp;tense]]


|-


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[first-person|1st&nbsp;person]]&nbsp;[[singular]]


| <span class="Latn" lang="nl">[[slaap#Dutch|slaap]]</span>

| <span class="Latn" lang="nl">[[sliep#Dutch|sliep]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[second-person|2nd&nbsp;person]]&nbsp;[[singular|sing.]]&nbsp;(<span lang="nl">[[jij#Dutch|jij]]</span>)


| <span class="Latn" lang="nl">[[slaapt#Dutch|slaapt]]</span>

| <span class="Latn" lang="nl">[[sliep#Dutch|sliep]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[second-person|2nd&nbsp;person]]&nbsp;[[singular|sing.]]&nbsp;(<span lang="nl">[[u#Dutch|u]]</span>)


| <span class="Latn" lang="nl">[[slaapt#Dutch|slaapt]]</span>

| <span class="Latn" lang="nl">[[sliep#Dutch|sliep]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[second-person|2nd&nbsp;person]]&nbsp;[[singular|sing.]]&nbsp;(<span lang="nl">[[gij#Dutch|gij]]</span>)


| <span class="Latn" lang="nl">[[slaapt#Dutch|slaapt]]</span>

| <span class="Latn" lang="nl">[[sliept#Dutch|sliept]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[third-person|3rd&nbsp;person]]&nbsp;[[singular]]


| <span class="Latn" lang="nl">[[slaapt#Dutch|slaapt]]</span>

| <span class="Latn" lang="nl">[[sliep#Dutch|sliep]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[plural]]


| <span class="Latn" lang="nl">[[slapen#Dutch|slapen]]</span>

| <span class="Latn" lang="nl">[[sliepen#Dutch|sliepen]]</span>


|- class="vsHide" style="background%3A+%23E6E6FF%3B+height%3A+0.5em"

|


| colspan="2" |


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[subjunctive]]&nbsp;[[singular|sing.]]<sup>1</sup>


| <span class="Latn" lang="nl">[[slape#Dutch|slape]]</span>

| <span class="Latn" lang="nl">[[sliepe#Dutch|sliepe]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[subjunctive]]&nbsp;[[plural|plur.]]<sup>1</sup>


| <span class="Latn" lang="nl">[[slapen#Dutch|slapen]]</span>

| <span class="Latn" lang="nl">[[sliepen#Dutch|sliepen]]</span>


|- class="vsHide" style="background%3A+%23E6E6FF%3B+height%3A+0.5em"

|


| colspan="2" |


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[imperative]]&nbsp;[[singular|sing.]]


| <span class="Latn" lang="nl">[[slaap#Dutch|slaap]]</span>


| rowspan="2" style="background%3A+%23E6E6FF%3B" |


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[imperative]]&nbsp;[[plural|plur.]]<sup>1</sup>


| <span class="Latn" lang="nl">[[slaapt#Dutch|slaapt]]</span>


|- class="vsHide" style="background%3A+%23E6E6FF%3B+height%3A+0.5em"

|


| colspan="2" |


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[participles]]


| <span class="Latn" lang="nl">[[slapend#Dutch|slapend]]</span>

| <span class="Latn" lang="nl">[[geslapen#Dutch|geslapen]]</span>


|- class="vsHide" style="background%3A+%23E6E6FF%3B"

| colspan="5" style="text-align%3Aleft%3B+vertical-align%3Atop%3B+font-size%3A+smaller%3B+line-height%3A+1em" | <sup>1)</sup> [[Wiktionary:Glossary#archaic|Archaic]].


|}
[[Category:Dutch class 7 strong verbs|SLAPEN]][[Category:Dutch basic verbs|SLAPEN]]
""")
        expected = {
            "forms": [{
                "form": "strong",
                "source": "Inflection",
                "tags": ["table-tags"]
            }, {
                "form": "7",
                "source": "Inflection",
                "tags": ["class"]
            }, {
                "form": "slapen",
                "source": "Inflection",
                "tags": ["infinitive"]
            }, {
                "form": "slapen",
                "source": "Inflection",
                "tags": ["gerund", "neuter"]
            }, {
                "form": "slaap",
                "source": "Inflection",
                "tags": ["first-person", "present", "singular"]
            }, {
                "form": "sliep",
                "source": "Inflection",
                "tags": ["first-person", "past", "singular"]
            }, {
                "form": "slaapt",
                "source": "Inflection",
                "tags": ["present", "second-person", "singular"]
            }, {
                "form": "sliep",
                "source": "Inflection",
                "tags": ["past", "second-person", "singular"]
            }, {
                "form":
                "slaapt",
                "source":
                "Inflection",
                "tags": ["formal", "present", "second-person", "singular"]
            }, {
                "form": "sliep",
                "source": "Inflection",
                "tags": ["formal", "past", "second-person", "singular"]
            }, {
                "form":
                "slaapt",
                "source":
                "Inflection",
                "tags": [
                    "Flanders", "colloquial", "present", "second-person",
                    "singular"
                ]
            }, {
                "form":
                "slaapt",
                "source":
                "Inflection",
                "tags": [
                    "archaic", "formal", "majestic", "present",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "sliept",
                "source":
                "Inflection",
                "tags": [
                    "Flanders", "colloquial", "past", "second-person",
                    "singular"
                ]
            }, {
                "form":
                "sliept",
                "source":
                "Inflection",
                "tags": [
                    "archaic", "formal", "majestic", "past", "second-person",
                    "singular"
                ]
            }, {
                "form": "slaapt",
                "source": "Inflection",
                "tags": ["present", "singular", "third-person"]
            }, {
                "form": "sliep",
                "source": "Inflection",
                "tags": ["past", "singular", "third-person"]
            }, {
                "form": "slapen",
                "source": "Inflection",
                "tags": ["plural", "present"]
            }, {
                "form": "sliepen",
                "source": "Inflection",
                "tags": ["past", "plural"]
            }, {
                "form": "slape",
                "source": "Inflection",
                "tags": ["archaic", "present", "singular", "subjunctive"]
            }, {
                "form": "sliepe",
                "source": "Inflection",
                "tags": ["archaic", "past", "singular", "subjunctive"]
            }, {
                "form": "slapen",
                "source": "Inflection",
                "tags": ["archaic", "plural", "present", "subjunctive"]
            }, {
                "form": "sliepen",
                "source": "Inflection",
                "tags": ["archaic", "past", "plural", "subjunctive"]
            }, {
                "form": "slaap",
                "source": "Inflection",
                "tags": ["imperative", "present", "singular"]
            }, {
                "form": "slaapt",
                "source": "Inflection",
                "tags": ["archaic", "imperative", "plural", "present"]
            }, {
                "form": "slapend",
                "source": "Inflection",
                "tags": ["participle", "present"]
            }, {
                "form": "geslapen",
                "source": "Inflection",
                "tags": ["participle", "past"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Dutch_adj1(self):
        ret = self.xinfl(
            "mooi", "Dutch", "adj", "Inflection", """
{| style="border%3A+1px+solid+%23CCCCFF%3B+text-align%3A+center%3B+line-height%3A+125%25%3B" class="inflection-table+vsSwitcher" data-toggle-category="inflection" cellspacing="1" cellpadding="3"

|- style="background%3A+%23CCCCFF%3B"

! colspan="5" class="vsToggleElement" style="text-align%3A+left" | Inflection of <i class="Latn+mention" lang="nl">mooi</i>


|- class="vsShow" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | uninflected


| style="min-width%3A+12em%3B" | <span class="Latn+form-of+lang-nl+indef%7Cn%7Cs-form-of++++++form-of-nostore+" lang="nl">[[mooi#Dutch|mooi]]</span>


|- class="vsShow" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | inflected


| <span class="Latn+form-of+lang-nl+indef%7Cm%7Cand%7Cf%7Cs-form-of++++++form-of-nostore+" lang="nl">[[mooie#Dutch|mooie]]</span>


|- class="vsShow" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | comparative


| <span class="Latn+form-of+lang-nl+indef%7Cn%7Cs%7Ccomd-form-of++++++form-of-nostore+" lang="nl">[[mooier#Dutch|mooier]]</span>


|- class="vsHide" style="background%3A+%23CCCCFF%3B"

| colspan="2" style="background%3A+%23E6E6FF%3B" |


! style="min-width%3A+12em%3B" | [[positive degree|positive]]


! style="min-width%3A+12em%3B" | [[comparative degree|comparative]]


! style="min-width%3A+12em%3B" | [[superlative degree|superlative]]


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" colspan="2" | [[predicative]]/[[adverbial]]


| <span class="Latn+form-of+lang-nl+pred-form-of+++++++" lang="nl">[[mooi#Dutch|mooi]]</span>

| <span class="Latn+form-of+lang-nl+pred%7Ccomd-form-of+++++++" lang="nl">[[mooier#Dutch|mooier]]</span>

| <span class="Latn+form-of+lang-nl+pred%7Csupd-form-of+++++++" lang="nl">het [[mooist#Dutch|mooist]]</span><br><span class="Latn+form-of+lang-nl+pred%7Csupd-form-of+++++++" lang="nl">het [[mooiste#Dutch|mooiste]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" rowspan="3" | [[indefinite]]


! style="background%3A+%23CCCCFF%3B" | [[masculine|m.]]/[[feminine|f.]]&nbsp;[[singular|sing.]]


| <span class="Latn+form-of+lang-nl+indef%7Cm%7Cand%7Cf%7Cs-form-of+++++++" lang="nl">[[mooie#Dutch|mooie]]</span>

| <span class="Latn+form-of+lang-nl+indef%7Cm%7Cand%7Cf%7Cs%7Ccomd-form-of+++++++" lang="nl">[[mooiere#Dutch|mooiere]]</span>

| <span class="Latn+form-of+lang-nl+indef%7Cm%7Cand%7Cf%7Cs%7Csupd-form-of+++++++" lang="nl">[[mooiste#Dutch|mooiste]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" | [[neuter|n.]]&nbsp;[[singular|sing.]]


| <span class="Latn+form-of+lang-nl+indef%7Cn%7Cs-form-of+++++++" lang="nl">[[mooi#Dutch|mooi]]</span>

| <span class="Latn+form-of+lang-nl+indef%7Cn%7Cs%7Ccomd-form-of+++++++" lang="nl">[[mooier#Dutch|mooier]]</span>

| <span class="Latn+form-of+lang-nl+indef%7Cn%7Cs%7Csupd-form-of+++++++" lang="nl">[[mooiste#Dutch|mooiste]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A%23CCCCFF%3B" | [[plural]]


| <span class="Latn+form-of+lang-nl+indef%7Cp-form-of+++++++" lang="nl">[[mooie#Dutch|mooie]]</span>

| <span class="Latn+form-of+lang-nl+indef%7Cp%7Ccomd-form-of+++++++" lang="nl">[[mooiere#Dutch|mooiere]]</span>

| <span class="Latn+form-of+lang-nl+indef%7Cp%7Csupd-form-of+++++++" lang="nl">[[mooiste#Dutch|mooiste]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" colspan="2" | [[definite]]


| <span class="Latn+form-of+lang-nl+def-form-of+++++++" lang="nl">[[mooie#Dutch|mooie]]</span>

| <span class="Latn+form-of+lang-nl+def%7Ccomd-form-of+++++++" lang="nl">[[mooiere#Dutch|mooiere]]</span>

| <span class="Latn+form-of+lang-nl+def%7Csupd-form-of+++++++" lang="nl">[[mooiste#Dutch|mooiste]]</span>


|- class="vsHide" style="background%3A+%23F2F2FF%3B"

! style="background%3A+%23CCCCFF%3B" colspan="2" | [[partitive]]


| <span class="Latn+form-of+lang-nl+par-form-of+++++++" lang="nl">[[moois#Dutch|moois]]</span>

| <span class="Latn+form-of+lang-nl+par%7Ccomd-form-of+++++++" lang="nl">[[mooiers#Dutch|mooiers]]</span>

| &mdash;


|}
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Inflection",
                "tags": ["table-tags"]
            }, {
                "form": "mooi",
                "source": "Inflection",
                "tags": ["adverbial", "positive", "predicative"]
            }, {
                "form": "mooier",
                "source": "Inflection",
                "tags": ["adverbial", "comparative", "predicative"]
            }, {
                "form": "het mooist",
                "source": "Inflection",
                "tags": ["adverbial", "predicative", "superlative"]
            }, {
                "form": "het mooiste",
                "source": "Inflection",
                "tags": ["adverbial", "predicative", "superlative"]
            }, {
                "form":
                "mooie",
                "source":
                "Inflection",
                "tags": [
                    "feminine", "indefinite", "masculine", "positive",
                    "singular"
                ]
            }, {
                "form":
                "mooiere",
                "source":
                "Inflection",
                "tags": [
                    "comparative", "feminine", "indefinite", "masculine",
                    "singular"
                ]
            }, {
                "form":
                "mooiste",
                "source":
                "Inflection",
                "tags": [
                    "feminine", "indefinite", "masculine", "singular",
                    "superlative"
                ]
            }, {
                "form": "mooi",
                "source": "Inflection",
                "tags": ["indefinite", "neuter", "positive", "singular"]
            }, {
                "form":
                "mooier",
                "source":
                "Inflection",
                "tags": ["comparative", "indefinite", "neuter", "singular"]
            }, {
                "form":
                "mooiste",
                "source":
                "Inflection",
                "tags": ["indefinite", "neuter", "singular", "superlative"]
            }, {
                "form": "mooie",
                "source": "Inflection",
                "tags": ["indefinite", "plural", "positive"]
            }, {
                "form": "mooiere",
                "source": "Inflection",
                "tags": ["comparative", "indefinite", "plural"]
            }, {
                "form": "mooiste",
                "source": "Inflection",
                "tags": ["indefinite", "plural", "superlative"]
            }, {
                "form": "mooie",
                "source": "Inflection",
                "tags": ["definite", "positive"]
            }, {
                "form": "mooiere",
                "source": "Inflection",
                "tags": ["comparative", "definite"]
            }, {
                "form": "mooiste",
                "source": "Inflection",
                "tags": ["definite", "superlative"]
            }, {
                "form": "moois",
                "source": "Inflection",
                "tags": ["partitive", "positive"]
            }, {
                "form": "mooiers",
                "source": "Inflection",
                "tags": ["comparative", "partitive"]
            }, {
                "form": "-",
                "source": "Inflection",
                "tags": ["partitive", "superlative"]
            }],
        }
        self.assertEqual(expected, ret)
class InflTests(unittest.TestCase):
    def setUp(self):
        self.maxDiff = 100000
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def xinfl(self, word, lang, pos, section, text):
        """Runs a single inflection table parsing test, and returns ``data``."""
        self.ctx.start_page(word)
        self.ctx.start_section(lang)
        self.ctx.start_subsection(pos)
        tree = self.ctx.parse(text)
        data = {}
        parse_inflection_section(self.config, self.ctx, data, word, lang, pos,
                                 section, tree)
        return data

    def test_Polish_verb1(self):
        ret = self.xinfl(
            "mówić", "Polish", "verb", "Conjugation", """
<div class="NavFrame">
<div class="NavHead+inflection-table-verb">Conjugation of <i class="Latn+mention" lang="pl">mówić</i>&nbsp;<span class="gender"><abbr title="imperfective+aspect">impf</abbr></span></div>
<div class="NavContent">

{| class="wikitable+inflection-table" style="margin%3A+1em+auto%3B"

|-

! rowspan="2" | &nbsp;


! &nbsp;


! colspan="3" title="liczba+pojedyncza" | singular


! colspan="2" title="liczba+mnoga" | plural


|-

! title="osoba" | person


! title="rodzaj+m%C4%99ski" | masculine


! title="rodzaj+%C5%BCe%C5%84ski" | feminine


! title="rodzaj+nijaki" | neuter


! title="rodzaj+m%C4%99skoosobowy" | virile


! title="rodzaj+niem%C4%99skoosobowy" | nonvirile


|-

! colspan="2" title="bezokolicznik" | infinitive


| colspan="5" | mówić


|-

! rowspan="4" title="czas+tera%C5%BAniejszy" | present tense


! title="pierwsza+osoba+%28ja%2C+my%29" | 1st


| colspan="3" | <span class="Latn" lang="pl">[[mówię#Polish|mówię]]</span>


| colspan="2" | <span class="Latn" lang="pl">[[mówimy#Polish|mówimy]]</span>


|-

! title="druga+osoba+%28ty%2C+wy%29" | 2nd


| colspan="3" | <span class="Latn" lang="pl">[[mówisz#Polish|mówisz]]</span>


| colspan="2" | <span class="Latn" lang="pl">[[mówicie#Polish|mówicie]]</span>


|-

! title="trzecia+osoba+%28on%2C+ona%2C+ono%2C+pan%2C+pani%2C+oni%2C+one%2C+pa%C5%84stwo%29" | 3rd


| colspan="3" | <span class="Latn" lang="pl">[[mówi#Polish|mówi]]</span>


| colspan="2" | <span class="Latn" lang="pl">[[mówią#Polish|mówią]]</span>


|-

! title="forma+bezosobowa" | impersonal


| colspan="5" | <span class="Latn" lang="pl">[[mówi#Polish|mówi]] [[się#Polish|się]]</span>


|-

! rowspan="4" title="czas+przesz%C5%82y" | past tense


! title="pierwsza+osoba+%28ja%2C+my%29" | 1st


| <span class="Latn" lang="pl">[[mówiłem#Polish|mówiłem]]</span>


| <span class="Latn" lang="pl">[[mówiłam#Polish|mówiłam]]</span>


|


| <span class="Latn" lang="pl">[[mówiliśmy#Polish|mówiliśmy]]</span>


| <span class="Latn" lang="pl">[[mówiłyśmy#Polish|mówiłyśmy]]</span>


|-

! title="druga+osoba+%28ty%2C+wy%29" | 2nd


| <span class="Latn" lang="pl">[[mówiłeś#Polish|mówiłeś]]</span>


| <span class="Latn" lang="pl">[[mówiłaś#Polish|mówiłaś]]</span>


|


| <span class="Latn" lang="pl">[[mówiliście#Polish|mówiliście]]</span>


| <span class="Latn" lang="pl">[[mówiłyście#Polish|mówiłyście]]</span>


|-

! title="trzecia+osoba+%28on%2C+ona%2C+ono%2C+pan%2C+pani%2C+oni%2C+one%2C+pa%C5%84stwo%29" | 3rd


| <span class="Latn" lang="pl">[[mówił#Polish|mówił]]</span>


| <span class="Latn" lang="pl">[[mówiła#Polish|mówiła]]</span>


| <span class="Latn" lang="pl">[[mówiło#Polish|mówiło]]</span>


| <span class="Latn" lang="pl">[[mówili#Polish|mówili]]</span>


| <span class="Latn" lang="pl">[[mówiły#Polish|mówiły]]</span>


|-

! title="forma+bezosobowa" | impersonal


| colspan="5" | <span class="Latn" lang="pl">[[mówiono#Polish|mówiono]]</span>


|-

! rowspan="4" title="czas+przysz%C5%82y" | future tense


! title="pierwsza+osoba+%28ja%2C+my%29" | 1st


| <span class="Latn" lang="pl">[[będę#Polish|będę]] [[mówił#Polish|mówił]]</span>,<br>będę mówić<br>


| <span class="Latn" lang="pl">[[będę#Polish|będę]] [[mówiła#Polish|mówiła]]</span>,<br>będę mówić<br>


|


| <span class="Latn" lang="pl">[[będziemy#Polish|będziemy]] [[mówili#Polish|mówili]]</span>,<br>będziemy mówić<br>


| <span class="Latn" lang="pl">[[będziemy#Polish|będziemy]] [[mówiły#Polish|mówiły]]</span>,<br>będziemy mówić<br>


|-

! title="druga+osoba+%28ty%2C+wy%29" | 2nd


| <span class="Latn" lang="pl">[[będziesz#Polish|będziesz]] [[mówił#Polish|mówił]]</span>,<br>będziesz mówić<br>


| <span class="Latn" lang="pl">[[będziesz#Polish|będziesz]] [[mówiła#Polish|mówiła]]</span>,<br>będziesz mówić<br>


|


| <span class="Latn" lang="pl">[[będziecie#Polish|będziecie]] [[mówili#Polish|mówili]]</span>,<br>będziecie mówić<br>


| <span class="Latn" lang="pl">[[będziecie#Polish|będziecie]] [[mówiły#Polish|mówiły]]</span>,<br>będziecie mówić<br>


|-

! title="trzecia+osoba+%28on%2C+ona%2C+ono%2C+pan%2C+pani%2C+oni%2C+one%2C+pa%C5%84stwo%29" | 3rd


| <span class="Latn" lang="pl">[[będzie#Polish|będzie]] [[mówił#Polish|mówił]]</span>,<br>będzie mówić<br>


| <span class="Latn" lang="pl">[[będzie#Polish|będzie]] [[mówiła#Polish|mówiła]]</span>,<br>będzie mówić<br>


| <span class="Latn" lang="pl">[[będzie#Polish|będzie]] [[mówiło#Polish|mówiło]]</span>,<br>będzie mówić<br>


| <span class="Latn" lang="pl">[[będą#Polish|będą]] [[mówili#Polish|mówili]]</span>,<br>będą mówić<br>


| <span class="Latn" lang="pl">[[będą#Polish|będą]] [[mówiły#Polish|mówiły]]</span>,<br>będą mówić<br>


|-

! title="forma+bezosobowa" | impersonal


| colspan="5" | <span class="Latn" lang="pl">[[będzie#Polish|będzie]] mówić [[się#Polish|się]]</span>


|-

! rowspan="4" title="tryb+przypuszczaj%C4%85cy" | conditional


! title="pierwsza+osoba+%28ja%2C+my%29" | 1st


| <span class="Latn" lang="pl">[[mówiłbym#Polish|mówiłbym]]</span>


| <span class="Latn" lang="pl">[[mówiłabym#Polish|mówiłabym]]</span>


|


| <span class="Latn" lang="pl">[[mówilibyśmy#Polish|mówilibyśmy]]</span>


| <span class="Latn" lang="pl">[[mówiłybyśmy#Polish|mówiłybyśmy]]</span>


|-

! title="druga+osoba+%28ty%2C+wy%29" | 2nd


| <span class="Latn" lang="pl">[[mówiłbyś#Polish|mówiłbyś]]</span>


| <span class="Latn" lang="pl">[[mówiłabyś#Polish|mówiłabyś]]</span>


|


| <span class="Latn" lang="pl">[[mówilibyście#Polish|mówilibyście]]</span>


| <span class="Latn" lang="pl">[[mówiłybyście#Polish|mówiłybyście]]</span>


|-

! title="trzecia+osoba+%28on%2C+ona%2C+ono%2C+pan%2C+pani%2C+oni%2C+one%2C+pa%C5%84stwo%29" | 3rd


| <span class="Latn" lang="pl">[[mówiłby#Polish|mówiłby]]</span>


| <span class="Latn" lang="pl">[[mówiłaby#Polish|mówiłaby]]</span>


| <span class="Latn" lang="pl">[[mówiłoby#Polish|mówiłoby]]</span>


| <span class="Latn" lang="pl">[[mówiliby#Polish|mówiliby]]</span>


| <span class="Latn" lang="pl">[[mówiłyby#Polish|mówiłyby]]</span>


|-

! title="forma+bezosobowa" | impersonal


| colspan="5" | <span class="Latn" lang="pl">[[mówiono#Polish|mówiono]] [[by#Polish|by]]</span>


|-

! rowspan="3" title="tryb+rozkazuj%C4%85cy" | imperative


! title="pierwsza+osoba+%28ja%2C+my%29" | 1st


| colspan="3" | <span class="Latn" lang="pl">[[niech#Polish|niech]] [[mówię#Polish|mówię]]</span>


| colspan="2" | <span class="Latn" lang="pl">[[mówmy#Polish|mówmy]]</span>


|-

! title="druga+osoba+%28ty%2C+wy%29" | 2nd


| colspan="3" | <span class="Latn" lang="pl">[[mów#Polish|mów]]</span>


| colspan="2" | <span class="Latn" lang="pl">[[mówcie#Polish|mówcie]]</span>


|-

! title="trzecia+osoba+%28on%2C+ona%2C+ono%2C+pan%2C+pani%2C+oni%2C+one%2C+pa%C5%84stwo%29" | 3rd


| colspan="3" | <span class="Latn" lang="pl">[[niech#Polish|niech]] [[mówi#Polish|mówi]]</span>


| colspan="2" | <span class="Latn" lang="pl">[[niech#Polish|niech]] [[mówią#Polish|mówią]]</span>


|-

! colspan="2" title="imies%C5%82%C3%B3w+przymiotnikowy+czynny" | active adjectival participle


| <span class="Latn" lang="pl">[[mówiący#Polish|mówiący]]</span>


| <span class="Latn" lang="pl">[[mówiąca#Polish|mówiąca]]</span>


| <span class="Latn" lang="pl">[[mówiące#Polish|mówiące]]</span>


| <span class="Latn" lang="pl">[[mówiący#Polish|mówiący]]</span>


| <span class="Latn" lang="pl">[[mówiące#Polish|mówiące]]</span>


|-

! colspan="2" title="imies%C5%82%C3%B3w+przymiotnikowy+bierny" | passive adjectival participle


| <span class="Latn" lang="pl">[[mówiony#Polish|mówiony]]</span>


| <span class="Latn" lang="pl">[[mówiona#Polish|mówiona]]</span>


| <span class="Latn" lang="pl">[[mówione#Polish|mówione]]</span>


| <span class="Latn" lang="pl">[[mówieni#Polish|mówieni]]</span>


| <span class="Latn" lang="pl">[[mówione#Polish|mówione]]</span>


|-

! colspan="2" title="imies%C5%82%C3%B3w+przys%C5%82%C3%B3wkowy+wsp%C3%B3%C5%82czesny" | contemporary adverbial participle


| colspan="5" | <span class="Latn" lang="pl">[[mówiąc#Polish|mówiąc]]</span>


|-

! colspan="2" title="rzeczownik+odczasownikowy" | verbal noun


| colspan="5" | <span class="Latn" lang="pl">[[mówienie#Polish|mówienie]]</span>


|-

|}
</div></div>
""")
        expected = {
            "forms": [{
                "form": "imperfective",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form": "mówić",
                "source": "Conjugation",
                "tags": ["infinitive"]
            }, {
                "form": "mówię",
                "source": "Conjugation",
                "tags": ["first-person", "present", "singular"]
            }, {
                "form": "mówimy",
                "source": "Conjugation",
                "tags": ["first-person", "plural", "present"]
            }, {
                "form": "mówisz",
                "source": "Conjugation",
                "tags": ["present", "second-person", "singular"]
            }, {
                "form": "mówicie",
                "source": "Conjugation",
                "tags": ["plural", "present", "second-person"]
            }, {
                "form": "mówi",
                "source": "Conjugation",
                "tags": ["present", "singular", "third-person"]
            }, {
                "form": "mówią",
                "source": "Conjugation",
                "tags": ["plural", "present", "third-person"]
            }, {
                "form": "mówi się",
                "source": "Conjugation",
                "tags": ["impersonal", "present"]
            }, {
                "form": "mówiłem",
                "source": "Conjugation",
                "tags": ["first-person", "masculine", "past", "singular"]
            }, {
                "form": "mówiłam",
                "source": "Conjugation",
                "tags": ["feminine", "first-person", "past", "singular"]
            }, {
                "form": "mówiliśmy",
                "source": "Conjugation",
                "tags": ["first-person", "past", "plural", "virile"]
            }, {
                "form": "mówiłyśmy",
                "source": "Conjugation",
                "tags": ["first-person", "nonvirile", "past", "plural"]
            }, {
                "form":
                "mówiłeś",
                "source":
                "Conjugation",
                "tags": ["masculine", "past", "second-person", "singular"]
            }, {
                "form": "mówiłaś",
                "source": "Conjugation",
                "tags": ["feminine", "past", "second-person", "singular"]
            }, {
                "form": "mówiliście",
                "source": "Conjugation",
                "tags": ["past", "plural", "second-person", "virile"]
            }, {
                "form": "mówiłyście",
                "source": "Conjugation",
                "tags": ["nonvirile", "past", "plural", "second-person"]
            }, {
                "form": "mówił",
                "source": "Conjugation",
                "tags": ["masculine", "past", "singular", "third-person"]
            }, {
                "form": "mówiła",
                "source": "Conjugation",
                "tags": ["feminine", "past", "singular", "third-person"]
            }, {
                "form": "mówiło",
                "source": "Conjugation",
                "tags": ["neuter", "past", "singular", "third-person"]
            }, {
                "form": "mówili",
                "source": "Conjugation",
                "tags": ["past", "plural", "third-person", "virile"]
            }, {
                "form": "mówiły",
                "source": "Conjugation",
                "tags": ["nonvirile", "past", "plural", "third-person"]
            }, {
                "form": "mówiono",
                "source": "Conjugation",
                "tags": ["impersonal", "past"]
            }, {
                "form":
                "będę mówił",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "masculine", "singular"]
            }, {
                "form":
                "będę mówić",
                "source":
                "Conjugation",
                "tags": ["first-person", "future", "masculine", "singular"]
            }, {
                "form":
                "będę mówiła",
                "source":
                "Conjugation",
                "tags": ["feminine", "first-person", "future", "singular"]
            }, {
                "form":
                "będę mówić",
                "source":
                "Conjugation",
                "tags": ["feminine", "first-person", "future", "singular"]
            }, {
                "form": "będziemy mówili",
                "source": "Conjugation",
                "tags": ["first-person", "future", "plural", "virile"]
            }, {
                "form": "będziemy mówić",
                "source": "Conjugation",
                "tags": ["first-person", "future", "plural", "virile"]
            }, {
                "form": "będziemy mówiły",
                "source": "Conjugation",
                "tags": ["first-person", "future", "nonvirile", "plural"]
            }, {
                "form": "będziemy mówić",
                "source": "Conjugation",
                "tags": ["first-person", "future", "nonvirile", "plural"]
            }, {
                "form":
                "będziesz mówił",
                "source":
                "Conjugation",
                "tags": ["future", "masculine", "second-person", "singular"]
            }, {
                "form":
                "będziesz mówić",
                "source":
                "Conjugation",
                "tags": ["future", "masculine", "second-person", "singular"]
            }, {
                "form":
                "będziesz mówiła",
                "source":
                "Conjugation",
                "tags": ["feminine", "future", "second-person", "singular"]
            }, {
                "form":
                "będziesz mówić",
                "source":
                "Conjugation",
                "tags": ["feminine", "future", "second-person", "singular"]
            }, {
                "form": "będziecie mówili",
                "source": "Conjugation",
                "tags": ["future", "plural", "second-person", "virile"]
            }, {
                "form": "będziecie mówić",
                "source": "Conjugation",
                "tags": ["future", "plural", "second-person", "virile"]
            }, {
                "form":
                "będziecie mówiły",
                "source":
                "Conjugation",
                "tags": ["future", "nonvirile", "plural", "second-person"]
            }, {
                "form":
                "będziecie mówić",
                "source":
                "Conjugation",
                "tags": ["future", "nonvirile", "plural", "second-person"]
            }, {
                "form":
                "będzie mówił",
                "source":
                "Conjugation",
                "tags": ["future", "masculine", "singular", "third-person"]
            }, {
                "form":
                "będzie mówić",
                "source":
                "Conjugation",
                "tags": ["future", "masculine", "singular", "third-person"]
            }, {
                "form":
                "będzie mówiła",
                "source":
                "Conjugation",
                "tags": ["feminine", "future", "singular", "third-person"]
            }, {
                "form":
                "będzie mówić",
                "source":
                "Conjugation",
                "tags": ["feminine", "future", "singular", "third-person"]
            }, {
                "form": "będzie mówiło",
                "source": "Conjugation",
                "tags": ["future", "neuter", "singular", "third-person"]
            }, {
                "form": "będzie mówić",
                "source": "Conjugation",
                "tags": ["future", "neuter", "singular", "third-person"]
            }, {
                "form": "będą mówili",
                "source": "Conjugation",
                "tags": ["future", "plural", "third-person", "virile"]
            }, {
                "form": "będą mówić",
                "source": "Conjugation",
                "tags": ["future", "plural", "third-person", "virile"]
            }, {
                "form": "będą mówiły",
                "source": "Conjugation",
                "tags": ["future", "nonvirile", "plural", "third-person"]
            }, {
                "form": "będą mówić",
                "source": "Conjugation",
                "tags": ["future", "nonvirile", "plural", "third-person"]
            }, {
                "form": "będzie mówić się",
                "source": "Conjugation",
                "tags": ["future", "impersonal"]
            }, {
                "form":
                "mówiłbym",
                "source":
                "Conjugation",
                "tags":
                ["conditional", "first-person", "masculine", "singular"]
            }, {
                "form":
                "mówiłabym",
                "source":
                "Conjugation",
                "tags":
                ["conditional", "feminine", "first-person", "singular"]
            }, {
                "form":
                "mówilibyśmy",
                "source":
                "Conjugation",
                "tags": ["conditional", "first-person", "plural", "virile"]
            }, {
                "form":
                "mówiłybyśmy",
                "source":
                "Conjugation",
                "tags": ["conditional", "first-person", "nonvirile", "plural"]
            }, {
                "form":
                "mówiłbyś",
                "source":
                "Conjugation",
                "tags":
                ["conditional", "masculine", "second-person", "singular"]
            }, {
                "form":
                "mówiłabyś",
                "source":
                "Conjugation",
                "tags":
                ["conditional", "feminine", "second-person", "singular"]
            }, {
                "form":
                "mówilibyście",
                "source":
                "Conjugation",
                "tags": ["conditional", "plural", "second-person", "virile"]
            }, {
                "form":
                "mówiłybyście",
                "source":
                "Conjugation",
                "tags":
                ["conditional", "nonvirile", "plural", "second-person"]
            }, {
                "form":
                "mówiłby",
                "source":
                "Conjugation",
                "tags":
                ["conditional", "masculine", "singular", "third-person"]
            }, {
                "form":
                "mówiłaby",
                "source":
                "Conjugation",
                "tags":
                ["conditional", "feminine", "singular", "third-person"]
            }, {
                "form":
                "mówiłoby",
                "source":
                "Conjugation",
                "tags": ["conditional", "neuter", "singular", "third-person"]
            }, {
                "form":
                "mówiliby",
                "source":
                "Conjugation",
                "tags": ["conditional", "plural", "third-person", "virile"]
            }, {
                "form":
                "mówiłyby",
                "source":
                "Conjugation",
                "tags": ["conditional", "nonvirile", "plural", "third-person"]
            }, {
                "form": "mówiono by",
                "source": "Conjugation",
                "tags": ["conditional", "impersonal"]
            }, {
                "form": "niech mówię",
                "source": "Conjugation",
                "tags": ["first-person", "imperative", "singular"]
            }, {
                "form": "mówmy",
                "source": "Conjugation",
                "tags": ["first-person", "imperative", "plural"]
            }, {
                "form": "mów",
                "source": "Conjugation",
                "tags": ["imperative", "second-person", "singular"]
            }, {
                "form": "mówcie",
                "source": "Conjugation",
                "tags": ["imperative", "plural", "second-person"]
            }, {
                "form": "niech mówi",
                "source": "Conjugation",
                "tags": ["imperative", "singular", "third-person"]
            }, {
                "form": "niech mówią",
                "source": "Conjugation",
                "tags": ["imperative", "plural", "third-person"]
            }, {
                "form":
                "mówiący",
                "source":
                "Conjugation",
                "tags": [
                    "active", "adjectival", "masculine", "participle",
                    "singular"
                ]
            }, {
                "form":
                "mówiąca",
                "source":
                "Conjugation",
                "tags":
                ["active", "adjectival", "feminine", "participle", "singular"]
            }, {
                "form":
                "mówiące",
                "source":
                "Conjugation",
                "tags":
                ["active", "adjectival", "neuter", "participle", "singular"]
            }, {
                "form":
                "mówiący",
                "source":
                "Conjugation",
                "tags":
                ["active", "adjectival", "participle", "plural", "virile"]
            }, {
                "form":
                "mówiące",
                "source":
                "Conjugation",
                "tags":
                ["active", "adjectival", "nonvirile", "participle", "plural"]
            }, {
                "form":
                "mówiony",
                "source":
                "Conjugation",
                "tags": [
                    "adjectival", "masculine", "participle", "passive",
                    "singular"
                ]
            }, {
                "form":
                "mówiona",
                "source":
                "Conjugation",
                "tags": [
                    "adjectival", "feminine", "participle", "passive",
                    "singular"
                ]
            }, {
                "form":
                "mówione",
                "source":
                "Conjugation",
                "tags":
                ["adjectival", "neuter", "participle", "passive", "singular"]
            }, {
                "form":
                "mówieni",
                "source":
                "Conjugation",
                "tags":
                ["adjectival", "participle", "passive", "plural", "virile"]
            }, {
                "form":
                "mówione",
                "source":
                "Conjugation",
                "tags":
                ["adjectival", "nonvirile", "participle", "passive", "plural"]
            }, {
                "form": "mówiąc",
                "source": "Conjugation",
                "tags": ["adjectival", "contemporary", "participle"]
            }, {
                "form": "mówienie",
                "source": "Conjugation",
                "tags": [
                    "noun-from-verb",
                ]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Polish_noun1(self):
        ret = self.xinfl(
            "dziecko", "Polish", "noun", "Declension", """
<div class="NavFrame+inflection-table-noun" style="width%3A+29em">
<div class="NavHead">Declension of <span class="Latn mention" lang="pl" xml:lang="pl">dziecko</span></div>
<div class="NavContent">

{| style="width%3A+29em%3B+margin%3A+0%3B" class="wikitable+inflection-table"

|-

! style="width%3A+8em%3B" |


! scope="col" | singular


! scope="col" | plural


|-

! title="mianownik+%28kto%3F+co%3F%29" scope="row" | nominative


| <span class="Latn" lang="pl" xml:lang="pl">[[dziecko]]</span>


| <span class="Latn" lang="pl" xml:lang="pl">[[dzieci#Polish|dzieci]]</span>


|-

! title="dope%C5%82niacz+%28kogo%3F+czego%3F%29" scope="row" | genitive


| <span class="Latn" lang="pl" xml:lang="pl">[[dziecka#Polish|dziecka]]</span>


| <span class="Latn" lang="pl" xml:lang="pl">[[dzieci#Polish|dzieci]]</span>


|-

! title="celownik+%28komu%3F+czemu%3F%29" scope="row" | dative


| <span class="Latn" lang="pl" xml:lang="pl">[[dziecku#Polish|dziecku]]</span>


| <span class="Latn" lang="pl" xml:lang="pl">[[dzieciom#Polish|dzieciom]]</span>


|-

! title="biernik+%28kogo%3F+co%3F%29" scope="row" | accusative


| <span class="Latn" lang="pl" xml:lang="pl">[[dziecko]]</span>


| <span class="Latn" lang="pl" xml:lang="pl">[[dzieci#Polish|dzieci]]</span>


|-

! title="narz%C4%99dnik+%28kim%3F+czym%3F%29" scope="row" | instrumental


| <span class="Latn" lang="pl" xml:lang="pl">[[dzieckiem#Polish|dzieckiem]]</span>


| <span class="Latn" lang="pl" xml:lang="pl">[[dziećmi#Polish|dziećmi]]</span>


|-

! title="miejscownik+%28o+kim%3F+o+czym%3F%29" scope="row" | locative


| <span class="Latn" lang="pl" xml:lang="pl">[[dziecku#Polish|dziecku]]</span>


| <span class="Latn" lang="pl" xml:lang="pl">[[dzieciach#Polish|dzieciach]]</span>


|-

! title="wo%C5%82acz+%28o%21%29" scope="row" | vocative


| <span class="Latn" lang="pl" xml:lang="pl">[[dziecko]]</span>


| <span class="Latn" lang="pl" xml:lang="pl">[[dzieci#Polish|dzieci]]</span>


|}
</div></div>
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form": "dziecko",
                "source": "Declension",
                "tags": ["nominative", "singular"]
            }, {
                "form": "dzieci",
                "source": "Declension",
                "tags": ["nominative", "plural"]
            }, {
                "form": "dziecka",
                "source": "Declension",
                "tags": ["genitive", "singular"]
            }, {
                "form": "dzieci",
                "source": "Declension",
                "tags": ["genitive", "plural"]
            }, {
                "form": "dziecku",
                "source": "Declension",
                "tags": ["dative", "singular"]
            }, {
                "form": "dzieciom",
                "source": "Declension",
                "tags": ["dative", "plural"]
            }, {
                "form": "dziecko",
                "source": "Declension",
                "tags": ["accusative", "singular"]
            }, {
                "form": "dzieci",
                "source": "Declension",
                "tags": ["accusative", "plural"]
            }, {
                "form": "dzieckiem",
                "source": "Declension",
                "tags": ["instrumental", "singular"]
            }, {
                "form": "dziećmi",
                "source": "Declension",
                "tags": ["instrumental", "plural"]
            }, {
                "form": "dziecku",
                "source": "Declension",
                "tags": ["locative", "singular"]
            }, {
                "form": "dzieciach",
                "source": "Declension",
                "tags": ["locative", "plural"]
            }, {
                "form": "dziecko",
                "source": "Declension",
                "tags": ["singular", "vocative"]
            }, {
                "form": "dzieci",
                "source": "Declension",
                "tags": ["plural", "vocative"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Polish_adj1(self):
        ret = self.xinfl(
            "wysoki", "Polish", "adj", "Declension", """
<div class="NavFrame+inflection-table-adj" style="width%3A+61em">
<div class="NavHead" align="left">declension of <i class="Latn mention" lang="pl" xml:lang="pl">wysoki</i></div>
<div class="NavContent">

{| class="wikitable+inflection-table" style="width%3A+61em%3B+margin%3A+0%3B+border%3A+none%3B"

|-

! rowspan="2" style="width%3A+11em%3B" title="przypadek" | case


! colspan="4" scope="colgroup" title="liczba+pojedyncza" | singular


! colspan="3" scope="colgroup" title="liczba+mnoga" | plural


|-

! style="min-width%3A+8em%3B" scope="col" title="rodzaj+m%C4%99skoosobowy%2Fm%C4%99skozwierz%C4%99cy" | masculine personal/animate


! style="min-width%3A+8em%3B" scope="col" title="rodzaj+m%C4%99skorzeczowy" | masculine inanimate


! style="min-width%3A+8em%3B" scope="col" title="rodzaj+nijaki" | neuter


! style="min-width%3A+8em%3B" scope="col" title="rodzaj+%C5%BCe%C5%84ski" | feminine


! style="min-width%3A+8em%3B" scope="col" title="rodzaj+m%C4%99skoosobowy" | virile


! style="min-width%3A+8em%3B" scope="col" title="rodzaj+niem%C4%99skoosobowy" | nonvirile


|-

! title="mianownik+%28jaki%3F+jaka%3F+jakie%3F%29%2C+wo%C5%82acz+%28o%21%29" scope="row" | nominative, vocative


| colspan="2" | <span class="Latn" lang="pl">[[wysoki#Polish|wysoki]]</span>


| <span class="Latn" lang="pl">[[wysokie#Polish|wysokie]]</span>


| <span class="Latn" lang="pl">[[wysoka#Polish|wysoka]]</span>


| <span class="Latn" lang="pl">[[wysocy#Polish|wysocy]]</span>


| <span class="Latn" lang="pl">[[wysokie#Polish|wysokie]]</span>


|-

! title="dope%C5%82niacz+%28jakiego%3F+jakiej%3F%29" scope="row" | genitive


| colspan="3" | <span class="Latn" lang="pl">[[wysokiego#Polish|wysokiego]]</span>


| rowspan="2" | <span class="Latn" lang="pl">[[wysokiej#Polish|wysokiej]]</span>


| colspan="2" | <span class="Latn" lang="pl">[[wysokich#Polish|wysokich]]</span>


|-

! title="celownik+%28jakiemu%3F+jakiej%3F%29" scope="row" | dative


| colspan="3" | <span class="Latn" lang="pl">[[wysokiemu#Polish|wysokiemu]]</span>


| colspan="2" | <span class="Latn" lang="pl">[[wysokim#Polish|wysokim]]</span>


|-

! title="biernik+%28jakiego%3F+jaki%3F+jak%C4%85%3F+jakie%3F%29" scope="row" | accusative


| <span class="Latn" lang="pl">[[wysokiego#Polish|wysokiego]]</span>


| <span class="Latn" lang="pl">[[wysoki#Polish|wysoki]]</span>


| <span class="Latn" lang="pl">[[wysokie#Polish|wysokie]]</span>


| rowspan="2" | <span class="Latn" lang="pl">[[wysoką#Polish|wysoką]]</span>


| <span class="Latn" lang="pl">[[wysokich#Polish|wysokich]]</span>


| <span class="Latn" lang="pl">[[wysokie#Polish|wysokie]]</span>


|-

! title="narz%C4%99dnik+%28jakim%3F+jak%C4%85%3F%29" scope="row" | instrumental


| colspan="3" rowspan="2" | <span class="Latn" lang="pl">[[wysokim#Polish|wysokim]]</span>


| colspan="2" | <span class="Latn" lang="pl">[[wysokimi#Polish|wysokimi]]</span>


|-

! title="miejscownik+%28jakim%3F+jakiej%3F%29" scope="row" | locative


| <span class="Latn" lang="pl">[[wysokiej#Polish|wysokiej]]</span>


| colspan="2" | <span class="Latn" lang="pl">[[wysokich#Polish|wysokich]]</span>


|}

</div>
</div>
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form":
                "wysoki",
                "source":
                "Declension",
                "tags": ["masculine", "nominative", "singular", "vocative"]
            }, {
                "form": "wysokie",
                "source": "Declension",
                "tags": ["neuter", "nominative", "singular", "vocative"]
            }, {
                "form":
                "wysoka",
                "source":
                "Declension",
                "tags": ["feminine", "nominative", "singular", "vocative"]
            }, {
                "form": "wysocy",
                "source": "Declension",
                "tags": ["nominative", "plural", "virile", "vocative"]
            }, {
                "form": "wysokie",
                "source": "Declension",
                "tags": ["nominative", "nonvirile", "plural", "vocative"]
            }, {
                "form": "wysokiego",
                "source": "Declension",
                "tags": ["genitive", "masculine", "neuter", "singular"]
            }, {
                "form": "wysokiej",
                "source": "Declension",
                "tags": ["feminine", "genitive", "singular"]
            }, {
                "form": "wysokich",
                "source": "Declension",
                "tags": ["genitive", "plural"]
            }, {
                "form": "wysokiemu",
                "source": "Declension",
                "tags": ["dative", "masculine", "neuter", "singular"]
            }, {
                "form": "wysokiej",
                "source": "Declension",
                "tags": ["dative", "feminine", "singular"]
            }, {
                "form": "wysokim",
                "source": "Declension",
                "tags": ["dative", "plural"]
            }, {
                "form":
                "wysokiego",
                "source":
                "Declension",
                "tags": ["accusative", "animate", "masculine", "singular"]
            }, {
                "form":
                "wysoki",
                "source":
                "Declension",
                "tags": ["accusative", "inanimate", "masculine", "singular"]
            }, {
                "form": "wysokie",
                "source": "Declension",
                "tags": ["accusative", "neuter", "singular"]
            }, {
                "form": "wysoką",
                "source": "Declension",
                "tags": ["accusative", "feminine", "singular"]
            }, {
                "form": "wysokich",
                "source": "Declension",
                "tags": ["accusative", "plural", "virile"]
            }, {
                "form": "wysokie",
                "source": "Declension",
                "tags": ["accusative", "nonvirile", "plural"]
            }, {
                "form":
                "wysokim",
                "source":
                "Declension",
                "tags": ["instrumental", "masculine", "neuter", "singular"]
            }, {
                "form": "wysoką",
                "source": "Declension",
                "tags": ["feminine", "instrumental", "singular"]
            }, {
                "form": "wysokimi",
                "source": "Declension",
                "tags": ["instrumental", "plural"]
            }, {
                "form": "wysokim",
                "source": "Declension",
                "tags": ["locative", "masculine", "neuter", "singular"]
            }, {
                "form": "wysokiej",
                "source": "Declension",
                "tags": ["feminine", "locative", "singular"]
            }, {
                "form": "wysokich",
                "source": "Declension",
                "tags": ["locative", "plural"]
            }],
        }
        self.assertEqual(expected, ret)
示例#10
0
class InflTests(unittest.TestCase):
    def setUp(self):
        self.maxDiff = 100000
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def xinfl(self, word, lang, pos, section, text):
        """Runs a single inflection table parsing test, and returns ``data``."""
        self.ctx.start_page(word)
        self.ctx.start_section(lang)
        self.ctx.start_subsection(pos)
        tree = self.ctx.parse(text)
        data = {}
        parse_inflection_section(self.config, self.ctx, data, word, lang, pos,
                                 section, tree)
        return data

    def test_Azerbaijani_noun1(self):
        ret = self.xinfl(
            "yardım", "Azerbaijani", "verb", "Declension", """
<div class="NavFrame" style>
<div class="NavHead" style>Declension of ''yardım''</div>
<div class="NavContent">

{| style="background%3A%23F9F9F9%3Bwidth%3A100%25%3Btext-align%3Acenter" class="inflection-table"

|-

! colspan="1" rowspan="1" style |


! colspan="1" rowspan="1" style="background%3A%23DEDEDE" |singular


| colspan="1" style="background%3A%23DEDEDE" |'''plural'''



|-

! style="background%3A%23EFEFEF" | nominative


| yardım


|[[yardımlar]]



|-

! style="background%3A%23EFEFEF" | definite accusative


|[[yardımı]]


|[[yardımları]]



|-

! style="background%3A%23EFEFEF" | dative


|[[yardıma]]


|[[yardımlara]]



|-

! style="background%3A%23EFEFEF" | locative


|[[yardımda]]


|[[yardımlarda]]



|-

! style="background%3A%23EFEFEF" | ablative


|[[yardımdan]]


|[[yardımlardan]]



|-

! style="background%3A%23EFEFEF" | definite genitive


|[[yardımın]]


|[[yardımların]]



|}
</div></div>
<div class="NavFrame" style>
<div class="NavHead" style>Possessive forms of ''yardım''</div>
<div class="NavContent">

{| style="background%3A%23F9F9F9%3Bwidth%3A100%25%3Btext-align%3Acenter" class="inflection-table"

|-

! colspan="1" style |


! colspan="2" style="background%3A%23DEDEDE" |nominative


|-

! colspan="1" rowspan="1" style |


! colspan="1" rowspan="1" style="background%3A%23DEDEDE" |singular


| colspan="1" style="background%3A%23DEDEDE" |'''plural'''



|-

! style="background%3A%23EFEFEF" | [[mənim]] (“my”)


|[[yardımım]]


|[[yardımlarım]]



|-

! style="background%3A%23EFEFEF" | [[sənin]] (“your”)


|[[yardımın]]


|[[yardımların]]



|-

! style="background%3A%23EFEFEF" | [[onun]] (“his/her/its”)


|[[yardımı]]


|[[yardımları]]



|-

! style="background%3A%23EFEFEF" | [[bizim]] (“our”)


|[[yardımımız]]


|[[yardımlarımız]]



|-

! style="background%3A%23EFEFEF" | [[sizin]] (“your”)


|[[yardımınız]]


|[[yardımlarınız]]



|-

! style="background%3A%23EFEFEF" | [[onların]] (“their”)


|[[yardımı]]&nbsp;''or'' [[yardımları]]


|[[yardımları]]



|-

! colspan="1" style |


! colspan="2" style="background%3A%23DEDEDE" |accusative


|-

! colspan="1" rowspan="1" style |


! colspan="1" rowspan="1" style="background%3A%23DEDEDE" |singular


| colspan="1" style="background%3A%23DEDEDE" |'''plural'''



|-

! style="background%3A%23EFEFEF" | [[mənim]] (“my”)


|[[yardımımı]]


|[[yardımlarımı]]



|-

! style="background%3A%23EFEFEF" | [[sənin]] (“your”)


|[[yardımını]]


|[[yardımlarını]]



|-

! style="background%3A%23EFEFEF" | [[onun]] (“his/her/its”)


|[[yardımını]]


|[[yardımlarını]]



|-

! style="background%3A%23EFEFEF" | [[bizim]] (“our”)


|[[yardımımızı]]


|[[yardımlarımızı]]



|-

! style="background%3A%23EFEFEF" | [[sizin]] (“your”)


|[[yardımınızı]]


|[[yardımlarınızı]]



|-

! style="background%3A%23EFEFEF" | [[onların]] (“their”)


|[[yardımını]]&nbsp;''or'' [[yardımlarını]]


|[[yardımlarını]]



|-

! colspan="1" style |


! colspan="2" style="background%3A%23DEDEDE" |dative


|-

! colspan="1" rowspan="1" style |


! colspan="1" rowspan="1" style="background%3A%23DEDEDE" |singular


| colspan="1" style="background%3A%23DEDEDE" |'''plural'''



|-

! style="background%3A%23EFEFEF" | [[mənim]] (“my”)


|[[yardımıma]]


|[[yardımlarıma]]



|-

! style="background%3A%23EFEFEF" | [[sənin]] (“your”)


|[[yardımına]]


|[[yardımlarına]]



|-

! style="background%3A%23EFEFEF" | [[onun]] (“his/her/its”)


|[[yardımına]]


|[[yardımlarına]]



|-

! style="background%3A%23EFEFEF" | [[bizim]] (“our”)


|[[yardımımıza]]


|[[yardımlarımıza]]



|-

! style="background%3A%23EFEFEF" | [[sizin]] (“your”)


|[[yardımınıza]]


|[[yardımlarınıza]]



|-

! style="background%3A%23EFEFEF" | [[onların]] (“their”)


|[[yardımına]]&nbsp;''or'' [[yardımlarına]]


|[[yardımlarına]]



|-

! colspan="1" style |


! colspan="2" style="background%3A%23DEDEDE" |locative


|-

! colspan="1" rowspan="1" style |


! colspan="1" rowspan="1" style="background%3A%23DEDEDE" |singular


| colspan="1" style="background%3A%23DEDEDE" |'''plural'''



|-

! style="background%3A%23EFEFEF" | [[mənim]] (“my”)


|[[yardımımda]]


|[[yardımlarımda]]



|-

! style="background%3A%23EFEFEF" | [[sənin]] (“your”)


|[[yardımında]]


|[[yardımlarında]]



|-

! style="background%3A%23EFEFEF" | [[onun]] (“his/her/its”)


|[[yardımında]]


|[[yardımlarında]]



|-

! style="background%3A%23EFEFEF" | [[bizim]] (“our”)


|[[yardımımızda]]


|[[yardımlarımızda]]



|-

! style="background%3A%23EFEFEF" | [[sizin]] (“your”)


|[[yardımınızda]]


|[[yardımlarınızda]]



|-

! style="background%3A%23EFEFEF" | [[onların]] (“their”)


|[[yardımında]]&nbsp;''or'' [[yardımlarında]]


|[[yardımlarında]]



|-

! colspan="1" style |


! colspan="2" style="background%3A%23DEDEDE" |ablative


|-

! colspan="1" rowspan="1" style |


! colspan="1" rowspan="1" style="background%3A%23DEDEDE" |singular


| colspan="1" style="background%3A%23DEDEDE" |'''plural'''



|-

! style="background%3A%23EFEFEF" | [[mənim]] (“my”)


|[[yardımımdan]]


|[[yardımlarımdan]]



|-

! style="background%3A%23EFEFEF" | [[sənin]] (“your”)


|[[yardımından]]


|[[yardımlarından]]



|-

! style="background%3A%23EFEFEF" | [[onun]] (“his/her/its”)


|[[yardımından]]


|[[yardımlarından]]



|-

! style="background%3A%23EFEFEF" | [[bizim]] (“our”)


|[[yardımımızdan]]


|[[yardımlarımızdan]]



|-

! style="background%3A%23EFEFEF" | [[sizin]] (“your”)


|[[yardımınızdan]]


|[[yardımlarınızdan]]



|-

! style="background%3A%23EFEFEF" | [[onların]] (“their”)


|[[yardımından]]&nbsp;''or'' [[yardımlarından]]


|[[yardımlarından]]



|-

! colspan="1" style |


! colspan="2" style="background%3A%23DEDEDE" |genitive


|-

! colspan="1" rowspan="1" style |


! colspan="1" rowspan="1" style="background%3A%23DEDEDE" |singular


| colspan="1" style="background%3A%23DEDEDE" |'''plural'''



|-

! style="background%3A%23EFEFEF" | [[mənim]] (“my”)


|[[yardımımın]]


|[[yardımlarımın]]



|-

! style="background%3A%23EFEFEF" | [[sənin]] (“your”)


|[[yardımının]]


|[[yardımlarının]]



|-

! style="background%3A%23EFEFEF" | [[onun]] (“his/her/its”)


|[[yardımının]]


|[[yardımlarının]]



|-

! style="background%3A%23EFEFEF" | [[bizim]] (“our”)


|[[yardımımızın]]


|[[yardımlarımızın]]



|-

! style="background%3A%23EFEFEF" | [[sizin]] (“your”)


|[[yardımınızın]]


|[[yardımlarınızın]]



|-

! style="background%3A%23EFEFEF" | [[onların]] (“their”)


|[[yardımının]]&nbsp;''or'' [[yardımlarının]]


|[[yardımlarının]]



|}
</div></div>
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form": "yardım",
                "source": "Declension",
                "tags": ["nominative", "singular"]
            }, {
                "form": "yardımlar",
                "source": "Declension",
                "tags": ["nominative", "plural"]
            }, {
                "form": "yardımı",
                "source": "Declension",
                "tags": ["accusative", "definite", "singular"]
            }, {
                "form": "yardımları",
                "source": "Declension",
                "tags": ["accusative", "definite", "plural"]
            }, {
                "form": "yardıma",
                "source": "Declension",
                "tags": ["dative", "singular"]
            }, {
                "form": "yardımlara",
                "source": "Declension",
                "tags": ["dative", "plural"]
            }, {
                "form": "yardımda",
                "source": "Declension",
                "tags": ["locative", "singular"]
            }, {
                "form": "yardımlarda",
                "source": "Declension",
                "tags": ["locative", "plural"]
            }, {
                "form": "yardımdan",
                "source": "Declension",
                "tags": ["ablative", "singular"]
            }, {
                "form": "yardımlardan",
                "source": "Declension",
                "tags": ["ablative", "plural"]
            }, {
                "form": "yardımın",
                "source": "Declension",
                "tags": ["definite", "genitive", "singular"]
            }, {
                "form": "yardımların",
                "source": "Declension",
                "tags": ["definite", "genitive", "plural"]
            }, {
                "form": "",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form":
                "yardımım",
                "source":
                "Declension",
                "tags": [
                    "first-person", "nominative", "possessive",
                    "possessive-single", "singular"
                ]
            }, {
                "form":
                "yardımlarım",
                "source":
                "Declension",
                "tags": [
                    "first-person", "nominative", "possessive",
                    "possessive-many", "singular"
                ]
            }, {
                "form":
                "yardımın",
                "source":
                "Declension",
                "tags": [
                    "nominative", "possessive", "possessive-single",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "yardımların",
                "source":
                "Declension",
                "tags": [
                    "nominative", "possessive", "possessive-many",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "yardımı",
                "source":
                "Declension",
                "tags": [
                    "nominative", "possessive", "possessive-single",
                    "singular", "third-person"
                ]
            }, {
                "form":
                "yardımları",
                "source":
                "Declension",
                "tags": [
                    "nominative", "possessive", "possessive-many", "singular",
                    "third-person"
                ]
            }, {
                "form":
                "yardımımız",
                "source":
                "Declension",
                "tags": [
                    "first-person", "nominative", "plural", "possessive",
                    "possessive-single"
                ]
            }, {
                "form":
                "yardımlarımız",
                "source":
                "Declension",
                "tags": [
                    "first-person", "nominative", "plural", "possessive",
                    "possessive-many"
                ]
            }, {
                "form":
                "yardımınız",
                "source":
                "Declension",
                "tags": [
                    "nominative", "plural", "possessive", "possessive-single",
                    "second-person"
                ]
            }, {
                "form":
                "yardımlarınız",
                "source":
                "Declension",
                "tags": [
                    "nominative", "plural", "possessive", "possessive-many",
                    "second-person"
                ]
            }, {
                "form":
                "yardımı",
                "source":
                "Declension",
                "tags": [
                    "nominative", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımları",
                "source":
                "Declension",
                "tags": [
                    "nominative", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımları",
                "source":
                "Declension",
                "tags": [
                    "nominative", "plural", "possessive", "possessive-many",
                    "third-person"
                ]
            }, {
                "form":
                "yardımımı",
                "source":
                "Declension",
                "tags": [
                    "accusative", "first-person", "possessive",
                    "possessive-single", "singular"
                ]
            }, {
                "form":
                "yardımlarımı",
                "source":
                "Declension",
                "tags": [
                    "accusative", "first-person", "possessive",
                    "possessive-many", "singular"
                ]
            }, {
                "form":
                "yardımını",
                "source":
                "Declension",
                "tags": [
                    "accusative", "possessive", "possessive-single",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "yardımlarını",
                "source":
                "Declension",
                "tags": [
                    "accusative", "possessive", "possessive-many",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "yardımını",
                "source":
                "Declension",
                "tags": [
                    "accusative", "possessive", "possessive-single",
                    "singular", "third-person"
                ]
            }, {
                "form":
                "yardımlarını",
                "source":
                "Declension",
                "tags": [
                    "accusative", "possessive", "possessive-many", "singular",
                    "third-person"
                ]
            }, {
                "form":
                "yardımımızı",
                "source":
                "Declension",
                "tags": [
                    "accusative", "first-person", "plural", "possessive",
                    "possessive-single"
                ]
            }, {
                "form":
                "yardımlarımızı",
                "source":
                "Declension",
                "tags": [
                    "accusative", "first-person", "plural", "possessive",
                    "possessive-many"
                ]
            }, {
                "form":
                "yardımınızı",
                "source":
                "Declension",
                "tags": [
                    "accusative", "plural", "possessive", "possessive-single",
                    "second-person"
                ]
            }, {
                "form":
                "yardımlarınızı",
                "source":
                "Declension",
                "tags": [
                    "accusative", "plural", "possessive", "possessive-many",
                    "second-person"
                ]
            }, {
                "form":
                "yardımını",
                "source":
                "Declension",
                "tags": [
                    "accusative", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarını",
                "source":
                "Declension",
                "tags": [
                    "accusative", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarını",
                "source":
                "Declension",
                "tags": [
                    "accusative", "plural", "possessive", "possessive-many",
                    "third-person"
                ]
            }, {
                "form":
                "yardımıma",
                "source":
                "Declension",
                "tags": [
                    "dative", "first-person", "possessive",
                    "possessive-single", "singular"
                ]
            }, {
                "form":
                "yardımlarıma",
                "source":
                "Declension",
                "tags": [
                    "dative", "first-person", "possessive", "possessive-many",
                    "singular"
                ]
            }, {
                "form":
                "yardımına",
                "source":
                "Declension",
                "tags": [
                    "dative", "possessive", "possessive-single",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "yardımlarına",
                "source":
                "Declension",
                "tags": [
                    "dative", "possessive", "possessive-many", "second-person",
                    "singular"
                ]
            }, {
                "form":
                "yardımına",
                "source":
                "Declension",
                "tags": [
                    "dative", "possessive", "possessive-single", "singular",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarına",
                "source":
                "Declension",
                "tags": [
                    "dative", "possessive", "possessive-many", "singular",
                    "third-person"
                ]
            }, {
                "form":
                "yardımımıza",
                "source":
                "Declension",
                "tags": [
                    "dative", "first-person", "plural", "possessive",
                    "possessive-single"
                ]
            }, {
                "form":
                "yardımlarımıza",
                "source":
                "Declension",
                "tags": [
                    "dative", "first-person", "plural", "possessive",
                    "possessive-many"
                ]
            }, {
                "form":
                "yardımınıza",
                "source":
                "Declension",
                "tags": [
                    "dative", "plural", "possessive", "possessive-single",
                    "second-person"
                ]
            }, {
                "form":
                "yardımlarınıza",
                "source":
                "Declension",
                "tags": [
                    "dative", "plural", "possessive", "possessive-many",
                    "second-person"
                ]
            }, {
                "form":
                "yardımına",
                "source":
                "Declension",
                "tags": [
                    "dative", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarına",
                "source":
                "Declension",
                "tags": [
                    "dative", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarına",
                "source":
                "Declension",
                "tags": [
                    "dative", "plural", "possessive", "possessive-many",
                    "third-person"
                ]
            }, {
                "form":
                "yardımımda",
                "source":
                "Declension",
                "tags": [
                    "first-person", "locative", "possessive",
                    "possessive-single", "singular"
                ]
            }, {
                "form":
                "yardımlarımda",
                "source":
                "Declension",
                "tags": [
                    "first-person", "locative", "possessive",
                    "possessive-many", "singular"
                ]
            }, {
                "form":
                "yardımında",
                "source":
                "Declension",
                "tags": [
                    "locative", "possessive", "possessive-single",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "yardımlarında",
                "source":
                "Declension",
                "tags": [
                    "locative", "possessive", "possessive-many",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "yardımında",
                "source":
                "Declension",
                "tags": [
                    "locative", "possessive", "possessive-single", "singular",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarında",
                "source":
                "Declension",
                "tags": [
                    "locative", "possessive", "possessive-many", "singular",
                    "third-person"
                ]
            }, {
                "form":
                "yardımımızda",
                "source":
                "Declension",
                "tags": [
                    "first-person", "locative", "plural", "possessive",
                    "possessive-single"
                ]
            }, {
                "form":
                "yardımlarımızda",
                "source":
                "Declension",
                "tags": [
                    "first-person", "locative", "plural", "possessive",
                    "possessive-many"
                ]
            }, {
                "form":
                "yardımınızda",
                "source":
                "Declension",
                "tags": [
                    "locative", "plural", "possessive", "possessive-single",
                    "second-person"
                ]
            }, {
                "form":
                "yardımlarınızda",
                "source":
                "Declension",
                "tags": [
                    "locative", "plural", "possessive", "possessive-many",
                    "second-person"
                ]
            }, {
                "form":
                "yardımında",
                "source":
                "Declension",
                "tags": [
                    "locative", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarında",
                "source":
                "Declension",
                "tags": [
                    "locative", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarında",
                "source":
                "Declension",
                "tags": [
                    "locative", "plural", "possessive", "possessive-many",
                    "third-person"
                ]
            }, {
                "form":
                "yardımımdan",
                "source":
                "Declension",
                "tags": [
                    "ablative", "first-person", "possessive",
                    "possessive-single", "singular"
                ]
            }, {
                "form":
                "yardımlarımdan",
                "source":
                "Declension",
                "tags": [
                    "ablative", "first-person", "possessive",
                    "possessive-many", "singular"
                ]
            }, {
                "form":
                "yardımından",
                "source":
                "Declension",
                "tags": [
                    "ablative", "possessive", "possessive-single",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "yardımlarından",
                "source":
                "Declension",
                "tags": [
                    "ablative", "possessive", "possessive-many",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "yardımından",
                "source":
                "Declension",
                "tags": [
                    "ablative", "possessive", "possessive-single", "singular",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarından",
                "source":
                "Declension",
                "tags": [
                    "ablative", "possessive", "possessive-many", "singular",
                    "third-person"
                ]
            }, {
                "form":
                "yardımımızdan",
                "source":
                "Declension",
                "tags": [
                    "ablative", "first-person", "plural", "possessive",
                    "possessive-single"
                ]
            }, {
                "form":
                "yardımlarımızdan",
                "source":
                "Declension",
                "tags": [
                    "ablative", "first-person", "plural", "possessive",
                    "possessive-many"
                ]
            }, {
                "form":
                "yardımınızdan",
                "source":
                "Declension",
                "tags": [
                    "ablative", "plural", "possessive", "possessive-single",
                    "second-person"
                ]
            }, {
                "form":
                "yardımlarınızdan",
                "source":
                "Declension",
                "tags": [
                    "ablative", "plural", "possessive", "possessive-many",
                    "second-person"
                ]
            }, {
                "form":
                "yardımından",
                "source":
                "Declension",
                "tags": [
                    "ablative", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarından",
                "source":
                "Declension",
                "tags": [
                    "ablative", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarından",
                "source":
                "Declension",
                "tags": [
                    "ablative", "plural", "possessive", "possessive-many",
                    "third-person"
                ]
            }, {
                "form":
                "yardımımın",
                "source":
                "Declension",
                "tags": [
                    "first-person", "genitive", "possessive",
                    "possessive-single", "singular"
                ]
            }, {
                "form":
                "yardımlarımın",
                "source":
                "Declension",
                "tags": [
                    "first-person", "genitive", "possessive",
                    "possessive-many", "singular"
                ]
            }, {
                "form":
                "yardımının",
                "source":
                "Declension",
                "tags": [
                    "genitive", "possessive", "possessive-single",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "yardımlarının",
                "source":
                "Declension",
                "tags": [
                    "genitive", "possessive", "possessive-many",
                    "second-person", "singular"
                ]
            }, {
                "form":
                "yardımının",
                "source":
                "Declension",
                "tags": [
                    "genitive", "possessive", "possessive-single", "singular",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarının",
                "source":
                "Declension",
                "tags": [
                    "genitive", "possessive", "possessive-many", "singular",
                    "third-person"
                ]
            }, {
                "form":
                "yardımımızın",
                "source":
                "Declension",
                "tags": [
                    "first-person", "genitive", "plural", "possessive",
                    "possessive-single"
                ]
            }, {
                "form":
                "yardımlarımızın",
                "source":
                "Declension",
                "tags": [
                    "first-person", "genitive", "plural", "possessive",
                    "possessive-many"
                ]
            }, {
                "form":
                "yardımınızın",
                "source":
                "Declension",
                "tags": [
                    "genitive", "plural", "possessive", "possessive-single",
                    "second-person"
                ]
            }, {
                "form":
                "yardımlarınızın",
                "source":
                "Declension",
                "tags": [
                    "genitive", "plural", "possessive", "possessive-many",
                    "second-person"
                ]
            }, {
                "form":
                "yardımının",
                "source":
                "Declension",
                "tags": [
                    "genitive", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarının",
                "source":
                "Declension",
                "tags": [
                    "genitive", "plural", "possessive", "possessive-single",
                    "third-person"
                ]
            }, {
                "form":
                "yardımlarının",
                "source":
                "Declension",
                "tags": [
                    "genitive", "plural", "possessive", "possessive-many",
                    "third-person"
                ]
            }],
        }
        self.assertEqual(expected, ret)
示例#11
0
class InflTests(unittest.TestCase):
    def setUp(self):
        self.maxDiff = 100000
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def xinfl(self, word, lang, pos, section, text):
        """Runs a single inflection table parsing test, and returns ``data``."""
        self.ctx.start_page(word)
        self.ctx.start_section(lang)
        self.ctx.start_subsection(pos)
        tree = self.ctx.parse(text)
        data = {}
        parse_inflection_section(self.config, self.ctx, data, word, lang, pos,
                                 section, tree)
        return data

    def test_Czech_verb1(self):
        ret = self.xinfl(
            "myslet", "Czech", "verb", "Conjugation", """
<div style="width%3A+44em%3B">
<div class="NavFrame+inflection-table-verb">
<div class="NavHead">Conjugation</div>
<div class="NavContent" style="text-align%3A+left%3B">

{| class="wikitable" style="width%3A+43em%3B"

|-

| '''Present forms'''

| colspan="2" |indicative

| colspan="2" |imperative


|-

|

|singular

|plural

|singular

|plural


|-

| style="width%3A+10em%3B" |1st person

| style="width%3A+7em%3B" |<span class="Latn" lang="cs">[[myslím#Czech|myslím]]</span>

| style="width%3A+7em%3B" |<span class="Latn" lang="cs">[[myslíme#Czech|myslíme]]</span>

| style="width%3A+7em%3B" | &mdash;

| style="width%3A+7em%3B" |<span class="Latn" lang="cs">[[mysleme#Czech|mysleme]]</span>


|-

|2nd person

| <span class="Latn" lang="cs">[[myslíš#Czech|myslíš]]</span>

| <span class="Latn" lang="cs">[[myslíte#Czech|myslíte]]</span>

| <span class="Latn" lang="cs">[[mysli#Czech|mysli]]</span>

| <span class="Latn" lang="cs">[[myslete#Czech|myslete]]</span>


|-

|3rd person

| <span class="Latn" lang="cs">[[myslí#Czech|myslí]]</span>

| <span class="Latn" lang="cs">[[myslí#Czech|myslí]]</span>, <span class="Latn" lang="cs">[[myslejí#Czech|myslejí]]</span>

| &mdash;

| &mdash;


|}



{| class="wikitable"

|-

|The future tense: a combination of a future form of <i class="Latn+mention" lang="cs">[[být#Czech|být]]</i> + infinitive ''myslet''.


|}



{| class="wikitable" style="width%3A+43em%3B"

|-

| '''Participles'''

| colspan="2" |Past participles

| colspan="2" |Passive participles


|-

|

|singular

|plural

|singular

|plural


|-

| style="width%3A+10em%3B" |masculine animate

| rowspan="2" style="width%3A+7em%3B" |<span class="Latn" lang="cs">[[myslel#Czech|myslel]]</span>, <span class="Latn" lang="cs">[[myslil#Czech|myslil]]</span>

| style="width%3A+7em%3B" |<span class="Latn" lang="cs">[[mysleli#Czech|mysleli]]</span>, <span class="Latn" lang="cs">[[myslili#Czech|myslili]]</span>

| rowspan="2" style="width%3A+7em%3B" |  <span class="Latn" lang="cs">[[myšlen#Czech|myšlen]]</span>

| style="width%3A+7em%3B" |<span class="Latn" lang="cs">[[myšleni#Czech|myšleni]]</span>


|-

|masculine inanimate

| rowspan="2" style="width%3A+7em%3B" |<span class="Latn" lang="cs">[[myslely#Czech|myslely]]</span>, <span class="Latn" lang="cs">[[myslily#Czech|myslily]]</span>

| rowspan="2" style="width%3A+7em%3B" |<span class="Latn" lang="cs">[[myšleny#Czech|myšleny]]</span>


|-

|feminine

|<span class="Latn" lang="cs">[[myslela#Czech|myslela]]</span>, <span class="Latn" lang="cs">[[myslila#Czech|myslila]]</span>

|<span class="Latn" lang="cs">[[myšlena#Czech|myšlena]]</span>


|-

|neuter

|<span class="Latn" lang="cs">[[myslelo#Czech|myslelo]]</span>, <span class="Latn" lang="cs">[[myslilo#Czech|myslilo]]</span>

| <span class="Latn" lang="cs">[[myslela#Czech|myslela]]</span>, <span class="Latn" lang="cs">[[myslila#Czech|myslila]]</span>

| <span class="Latn" lang="cs">[[myšleno#Czech|myšleno]]</span>

|<span class="Latn" lang="cs">[[myšlena#Czech|myšlena]]</span>


|}



{| class="wikitable"

|-

| '''Transgressives'''

|present

|past


|-

| masculine singular

| style="width%3A+7em%3B" | <span class="Latn" lang="cs">[[mysle#Czech|mysle]]</span>, <span class="Latn" lang="cs">[[mysleje#Czech|mysleje]]</span>

| style="width%3A+7em%3B" | &mdash;


|-

| feminine + neuter singular

|<span class="Latn" lang="cs">[[myslíc#Czech|myslíc]]</span>, <span class="Latn" lang="cs">[[myslejíc#Czech|myslejíc]]</span>

| &mdash;


|-

| plural

| <span class="Latn" lang="cs">[[myslíce#Czech|myslíce]]</span>, <span class="Latn" lang="cs">[[myslejíce#Czech|myslejíce]]</span>

| &mdash;


|}

</div></div></div>
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form":
                "myslím",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "present", "singular"]
            }, {
                "form":
                "myslíme",
                "source":
                "Conjugation",
                "tags": ["first-person", "indicative", "plural", "present"]
            }, {
                'form':
                '-',
                'source':
                'Conjugation',
                'tags': ['first-person', 'imperative', 'present', 'singular']
            }, {
                "form":
                "mysleme",
                "source":
                "Conjugation",
                "tags": ["first-person", "imperative", "plural", "present"]
            }, {
                "form":
                "myslíš",
                "source":
                "Conjugation",
                "tags": ["indicative", "present", "second-person", "singular"]
            }, {
                "form":
                "myslíte",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "second-person"]
            }, {
                "form":
                "mysli",
                "source":
                "Conjugation",
                "tags": ["imperative", "present", "second-person", "singular"]
            }, {
                "form":
                "myslete",
                "source":
                "Conjugation",
                "tags": ["imperative", "plural", "present", "second-person"]
            }, {
                "form":
                "myslí",
                "source":
                "Conjugation",
                "tags": ["indicative", "present", "singular", "third-person"]
            }, {
                "form":
                "myslí",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "third-person"]
            }, {
                "form":
                "myslejí",
                "source":
                "Conjugation",
                "tags": ["indicative", "plural", "present", "third-person"]
            }, {
                'form':
                '-',
                'source':
                'Conjugation',
                'tags': ['imperative', 'present', 'singular', 'third-person']
            }, {
                'form':
                '-',
                'source':
                'Conjugation',
                'tags': ['imperative', 'plural', 'present', 'third-person']
            }, {
                "form": "",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form":
                "myslel",
                "source":
                "Conjugation",
                "tags":
                ["animate", "masculine", "participle", "past", "singular"]
            }, {
                "form":
                "myslil",
                "source":
                "Conjugation",
                "tags":
                ["animate", "masculine", "participle", "past", "singular"]
            }, {
                "form":
                "mysleli",
                "source":
                "Conjugation",
                "tags":
                ["animate", "masculine", "participle", "past", "plural"]
            }, {
                "form":
                "myslili",
                "source":
                "Conjugation",
                "tags":
                ["animate", "masculine", "participle", "past", "plural"]
            }, {
                "form":
                "myšlen",
                "source":
                "Conjugation",
                "tags":
                ["animate", "masculine", "participle", "passive", "singular"]
            }, {
                "form":
                "myšleni",
                "source":
                "Conjugation",
                "tags":
                ["animate", "masculine", "participle", "passive", "plural"]
            }, {
                "form":
                "myslel",
                "source":
                "Conjugation",
                "tags":
                ["inanimate", "masculine", "participle", "past", "singular"]
            }, {
                "form":
                "myslil",
                "source":
                "Conjugation",
                "tags":
                ["inanimate", "masculine", "participle", "past", "singular"]
            }, {
                "form":
                "myslely",
                "source":
                "Conjugation",
                "tags":
                ["inanimate", "masculine", "participle", "past", "plural"]
            }, {
                "form":
                "myslily",
                "source":
                "Conjugation",
                "tags":
                ["inanimate", "masculine", "participle", "past", "plural"]
            }, {
                "form":
                "myšlen",
                "source":
                "Conjugation",
                "tags": [
                    "inanimate", "masculine", "participle", "passive",
                    "singular"
                ]
            }, {
                "form":
                "myšleny",
                "source":
                "Conjugation",
                "tags":
                ["inanimate", "masculine", "participle", "passive", "plural"]
            }, {
                "form": "myslela",
                "source": "Conjugation",
                "tags": ["feminine", "participle", "past", "singular"]
            }, {
                "form": "myslila",
                "source": "Conjugation",
                "tags": ["feminine", "participle", "past", "singular"]
            }, {
                "form": "myslely",
                "source": "Conjugation",
                "tags": ["feminine", "participle", "past", "plural"]
            }, {
                "form": "myslily",
                "source": "Conjugation",
                "tags": ["feminine", "participle", "past", "plural"]
            }, {
                "form": "myšlena",
                "source": "Conjugation",
                "tags": ["feminine", "participle", "passive", "singular"]
            }, {
                "form": "myšleny",
                "source": "Conjugation",
                "tags": ["feminine", "participle", "passive", "plural"]
            }, {
                "form": "myslelo",
                "source": "Conjugation",
                "tags": ["neuter", "participle", "past", "singular"]
            }, {
                "form": "myslilo",
                "source": "Conjugation",
                "tags": ["neuter", "participle", "past", "singular"]
            }, {
                "form": "myslela",
                "source": "Conjugation",
                "tags": ["neuter", "participle", "past", "plural"]
            }, {
                "form": "myslila",
                "source": "Conjugation",
                "tags": ["neuter", "participle", "past", "plural"]
            }, {
                "form": "myšleno",
                "source": "Conjugation",
                "tags": ["neuter", "participle", "passive", "singular"]
            }, {
                "form": "myšlena",
                "source": "Conjugation",
                "tags": ["neuter", "participle", "passive", "plural"]
            }, {
                "form": "",
                "source": "Conjugation",
                "tags": ["table-tags"]
            }, {
                "form":
                "mysle",
                "source":
                "Conjugation",
                "tags": ["masculine", "present", "singular", "transgressive"]
            }, {
                "form":
                "mysleje",
                "source":
                "Conjugation",
                "tags": ["masculine", "present", "singular", "transgressive"]
            }, {
                'form':
                '-',
                'source':
                'Conjugation',
                'tags': ['masculine', 'past', 'singular', 'transgressive']
            }, {
                "form":
                "myslíc",
                "source":
                "Conjugation",
                "tags":
                ["feminine", "neuter", "present", "singular", "transgressive"]
            }, {
                "form":
                "myslejíc",
                "source":
                "Conjugation",
                "tags":
                ["feminine", "neuter", "present", "singular", "transgressive"]
            }, {
                'form':
                '-',
                'source':
                'Conjugation',
                'tags':
                ['feminine', 'neuter', 'past', 'singular', 'transgressive']
            }, {
                "form": "myslíce",
                "source": "Conjugation",
                "tags": ["plural", "present", "transgressive"]
            }, {
                "form": "myslejíce",
                "source": "Conjugation",
                "tags": ["plural", "present", "transgressive"]
            }, {
                'form': '-',
                'source': 'Conjugation',
                'tags': ['past', 'plural', 'transgressive']
            }],
        }
        self.assertEqual(expected, ret)

    def test_Czech_noun1(self):
        ret = self.xinfl(
            "týden", "Czech", "noun", "Declension", """
<div class="NavFrame" style="width%3A30em">
<div class="NavHead">Declension</div>
<div class="NavContent">

{| style="width%3A30em%3B+margin%3A+0%3B" class="wikitable+inflection-table"

|-

! style="width%3A+7em" |


! singular


! plural


|-

! nominative


| <span class="Latn" lang="cs">[[týden#Czech|týden]]</span>


| <span class="Latn" lang="cs">[[týdny#Czech|týdny]]</span>


|-

! genitive


| <span class="Latn" lang="cs">[[týdne#Czech|týdne]]</span>


| <span class="Latn" lang="cs">[[týdnů#Czech|týdnů]]</span>


|-

! dative


| <span class="Latn" lang="cs">[[týdnu#Czech|týdnu]], [[týdni#Czech|týdni]]</span>


| <span class="Latn" lang="cs">[[týdnům#Czech|týdnům]]</span>


|-

! accusative


| <span class="Latn" lang="cs">[[týden#Czech|týden]]</span>


| <span class="Latn" lang="cs">[[týdny#Czech|týdny]]</span>


|-

! vocative


| <span class="Latn" lang="cs">[[týdne#Czech|týdne]], [[týdni#Czech|týdni]]</span>


| <span class="Latn" lang="cs">[[týdny#Czech|týdny]]</span>


|-

! locative


| <span class="Latn" lang="cs">[[týdnu#Czech|týdnu]], [[týdni#Czech|týdni]]</span>


| <span class="Latn" lang="cs">[[týdnech#Czech|týdnech]]</span>


|-

! instrumental


| <span class="Latn" lang="cs">[[týdnem#Czech|týdnem]]</span>


| <span class="Latn" lang="cs">[[týdny#Czech|týdny]]</span>


|}

</div></div>
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form": "týden",
                "source": "Declension",
                "tags": ["nominative", "singular"]
            }, {
                "form": "týdny",
                "source": "Declension",
                "tags": ["nominative", "plural"]
            }, {
                "form": "týdne",
                "source": "Declension",
                "tags": ["genitive", "singular"]
            }, {
                "form": "týdnů",
                "source": "Declension",
                "tags": ["genitive", "plural"]
            }, {
                "form": "týdnu",
                "source": "Declension",
                "tags": ["dative", "singular"]
            }, {
                "form": "týdni",
                "source": "Declension",
                "tags": ["dative", "singular"]
            }, {
                "form": "týdnům",
                "source": "Declension",
                "tags": ["dative", "plural"]
            }, {
                "form": "týden",
                "source": "Declension",
                "tags": ["accusative", "singular"]
            }, {
                "form": "týdny",
                "source": "Declension",
                "tags": ["accusative", "plural"]
            }, {
                "form": "týdne",
                "source": "Declension",
                "tags": ["singular", "vocative"]
            }, {
                "form": "týdni",
                "source": "Declension",
                "tags": ["singular", "vocative"]
            }, {
                "form": "týdny",
                "source": "Declension",
                "tags": ["plural", "vocative"]
            }, {
                "form": "týdnu",
                "source": "Declension",
                "tags": ["locative", "singular"]
            }, {
                "form": "týdni",
                "source": "Declension",
                "tags": ["locative", "singular"]
            }, {
                "form": "týdnech",
                "source": "Declension",
                "tags": ["locative", "plural"]
            }, {
                "form": "týdnem",
                "source": "Declension",
                "tags": ["instrumental", "singular"]
            }, {
                "form": "týdny",
                "source": "Declension",
                "tags": ["instrumental", "plural"]
            }],
        }
        self.assertEqual(expected, ret)

    def test_Czech_adj1(self):
        ret = self.xinfl(
            "dobrý", "Czech", "adj", "Declension", """
<div class="NavFrame" style="clear%3Aboth%3B+width%3A50em">
<div class="NavHead" align="center">Declension</div>
<div class="NavContent">

{| style="width%3A50em%3B+background%3A%23FFFFFF%3B" class="prettytable+inflection-table"

|-

! style="background%3A%23DEDEDE" colspan="5" |singular


|-

!&nbsp;


!masculine animate


!masculine inanimate


!feminine


!neuter


|-

!nominative


| colspan="2" align="center" |<span class="Latn" lang="cs">[[dobrý#Czech|dobrý]]</span>


|<span class="Latn" lang="cs">[[dobrá#Czech|dobrá]]</span>


|<span class="Latn" lang="cs">[[dobré#Czech|dobré]]</span>


|-

!genitive


| colspan="2" align="center" |<span class="Latn" lang="cs">[[dobrého#Czech|dobrého]]</span>


|<span class="Latn" lang="cs">[[dobré#Czech|dobré]]</span>


|<span class="Latn" lang="cs">[[dobrého#Czech|dobrého]]</span>


|-

!dative


| colspan="2" align="center" |<span class="Latn" lang="cs">[[dobrému#Czech|dobrému]]</span>


|<span class="Latn" lang="cs">[[dobré#Czech|dobré]]</span>


|<span class="Latn" lang="cs">[[dobrému#Czech|dobrému]]</span>


|-

!accusative


|<span class="Latn" lang="cs">[[dobrého#Czech|dobrého]]</span>


|<span class="Latn" lang="cs">[[dobrý#Czech|dobrý]]</span>


|<span class="Latn" lang="cs">[[dobrou#Czech|dobrou]]</span>


|<span class="Latn" lang="cs">[[dobré#Czech|dobré]]</span>


|-

!vocative


| colspan="2" align="center" |<span class="Latn" lang="cs">[[dobrý#Czech|dobrý]]</span>


|<span class="Latn" lang="cs">[[dobrá#Czech|dobrá]]</span>


|<span class="Latn" lang="cs">[[dobré#Czech|dobré]]</span>


|-

!locative


| colspan="2" align="center" |<span class="Latn" lang="cs">[[dobrém#Czech|dobrém]]</span>


|<span class="Latn" lang="cs">[[dobré#Czech|dobré]]</span>


|<span class="Latn" lang="cs">[[dobrém#Czech|dobrém]]</span>


|-

!instrumental


| colspan="2" align="center" |<span class="Latn" lang="cs">[[dobrým#Czech|dobrým]]</span>


|<span class="Latn" lang="cs">[[dobrou#Czech|dobrou]]</span>


|<span class="Latn" lang="cs">[[dobrým#Czech|dobrým]]</span>


|-

! style="background%3A%23DEDEDE" colspan="5" |plural


|-

!&nbsp;


!masculine animate


!masculine inanimate


!feminine


!neuter


|-

!nominative


|<span class="Latn" lang="cs">[[dobří#Czech|dobří]]</span>


| colspan="2" align="center" |<span class="Latn" lang="cs">[[dobré#Czech|dobré]]</span>


|<span class="Latn" lang="cs">[[dobrá#Czech|dobrá]]</span>


|-

!genitive


| colspan="4" align="center" |<span class="Latn" lang="cs">[[dobrých#Czech|dobrých]]</span>


|-

!dative


| colspan="4" align="center" |<span class="Latn" lang="cs">[[dobrým#Czech|dobrým]]</span>


|-

!accusative


| colspan="3" align="center" |<span class="Latn" lang="cs">[[dobré#Czech|dobré]]</span>


|<span class="Latn" lang="cs">[[dobrá#Czech|dobrá]]</span>


|-

!vocative


|<span class="Latn" lang="cs">[[dobří#Czech|dobří]]</span>


| colspan="2" align="center" |<span class="Latn" lang="cs">[[dobré#Czech|dobré]]</span>


|<span class="Latn" lang="cs">[[dobrá#Czech|dobrá]]</span>


|-

!locative


| colspan="4" align="center" |<span class="Latn" lang="cs">[[dobrých#Czech|dobrých]]</span>


|-

!instrumental


| colspan="4" align="center" |<span class="Latn" lang="cs">[[dobrými#Czech|dobrými]]</span>


|}
</div></div>
""")
        expected = {
            "forms": [{
                "form": "",
                "source": "Declension",
                "tags": ["table-tags"]
            }, {
                "form": "dobrý",
                "source": "Declension",
                "tags": ["masculine", "nominative", "singular"]
            }, {
                "form": "dobrá",
                "source": "Declension",
                "tags": ["feminine", "nominative", "singular"]
            }, {
                "form": "dobré",
                "source": "Declension",
                "tags": ["neuter", "nominative", "singular"]
            }, {
                "form": "dobrého",
                "source": "Declension",
                "tags": ["genitive", "masculine", "singular"]
            }, {
                "form": "dobré",
                "source": "Declension",
                "tags": ["feminine", "genitive", "singular"]
            }, {
                "form": "dobrého",
                "source": "Declension",
                "tags": ["genitive", "neuter", "singular"]
            }, {
                "form": "dobrému",
                "source": "Declension",
                "tags": ["dative", "masculine", "singular"]
            }, {
                "form": "dobré",
                "source": "Declension",
                "tags": ["dative", "feminine", "singular"]
            }, {
                "form": "dobrému",
                "source": "Declension",
                "tags": ["dative", "neuter", "singular"]
            }, {
                "form":
                "dobrého",
                "source":
                "Declension",
                "tags": ["accusative", "animate", "masculine", "singular"]
            }, {
                "form":
                "dobrý",
                "source":
                "Declension",
                "tags": ["accusative", "inanimate", "masculine", "singular"]
            }, {
                "form": "dobrou",
                "source": "Declension",
                "tags": ["accusative", "feminine", "singular"]
            }, {
                "form": "dobré",
                "source": "Declension",
                "tags": ["accusative", "neuter", "singular"]
            }, {
                "form": "dobrý",
                "source": "Declension",
                "tags": ["masculine", "singular", "vocative"]
            }, {
                "form": "dobrá",
                "source": "Declension",
                "tags": ["feminine", "singular", "vocative"]
            }, {
                "form": "dobré",
                "source": "Declension",
                "tags": ["neuter", "singular", "vocative"]
            }, {
                "form": "dobrém",
                "source": "Declension",
                "tags": ["locative", "masculine", "singular"]
            }, {
                "form": "dobré",
                "source": "Declension",
                "tags": ["feminine", "locative", "singular"]
            }, {
                "form": "dobrém",
                "source": "Declension",
                "tags": ["locative", "neuter", "singular"]
            }, {
                "form": "dobrým",
                "source": "Declension",
                "tags": ["instrumental", "masculine", "singular"]
            }, {
                "form": "dobrou",
                "source": "Declension",
                "tags": ["feminine", "instrumental", "singular"]
            }, {
                "form": "dobrým",
                "source": "Declension",
                "tags": ["instrumental", "neuter", "singular"]
            }, {
                "form": "dobří",
                "source": "Declension",
                "tags": ["animate", "masculine", "nominative", "plural"]
            }, {
                "form": "dobré",
                "source": "Declension",
                "tags": ["feminine", "nominative", "plural"]
            }, {
                "form":
                "dobré",
                "source":
                "Declension",
                "tags": ["inanimate", "masculine", "nominative", "plural"]
            }, {
                "form": "dobrá",
                "source": "Declension",
                "tags": ["neuter", "nominative", "plural"]
            }, {
                "form": "dobrých",
                "source": "Declension",
                "tags": ["genitive", "plural"]
            }, {
                "form": "dobrým",
                "source": "Declension",
                "tags": ["dative", "plural"]
            }, {
                "form": "dobré",
                "source": "Declension",
                "tags": ["accusative", "feminine", "masculine", "plural"]
            }, {
                "form": "dobrá",
                "source": "Declension",
                "tags": ["accusative", "neuter", "plural"]
            }, {
                "form": "dobří",
                "source": "Declension",
                "tags": ["animate", "masculine", "plural", "vocative"]
            }, {
                "form": "dobré",
                "source": "Declension",
                "tags": ["feminine", "plural", "vocative"]
            }, {
                "form": "dobré",
                "source": "Declension",
                "tags": ["inanimate", "masculine", "plural", "vocative"]
            }, {
                "form": "dobrá",
                "source": "Declension",
                "tags": ["neuter", "plural", "vocative"]
            }, {
                "form": "dobrých",
                "source": "Declension",
                "tags": ["locative", "plural"]
            }, {
                "form": "dobrými",
                "source": "Declension",
                "tags": ["instrumental", "plural"]
            }],
        }
        self.assertEqual(expected, ret)
示例#12
0
class HeadTests(unittest.TestCase):
    def setUp(self):
        self.ctx = Wtp()
        self.config = WiktionaryConfig()
        self.ctx.start_page("testpage")
        self.ctx.start_section("English")

    def test_reconstruction1(self):
        data = {}
        self.ctx.start_page("Reconstruction:Proto-Germanic/testpage")
        self.ctx.start_section("Proto-Germanic")
        parse_word_head(self.ctx, "noun", "*testpage", data, True)
        self.assertEqual(self.ctx.errors, [])
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {})

    def test_reconstruction2(self):
        data = {}
        self.ctx.start_page("Reconstruction:Proto-Germanic/testpage")
        self.ctx.start_section("Proto-Germanic")
        parse_word_head(self.ctx, "noun", "*testfoo", data, True)
        self.assertEqual(self.ctx.errors, [])
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {"forms": [{
                "form": "testfoo",
                "tags": ["canonical"]
            }]})

    def test_reconstruction3(self):
        data = {}
        parse_word_head(self.ctx, "noun", "*testpage", data, False)
        self.assertEqual(
            data, {"forms": [{
                "form": "*testpage",
                "tags": ["canonical"]
            }]})

    def test_head1(self):
        data = {}
        parse_word_head(self.ctx, "noun", "", data, False)
        self.assertEqual(self.ctx.errors, [])
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {})

    def test_head2(self):
        data = {}
        parse_word_head(self.ctx, "noun", "testpage", data, False)
        self.assertEqual(self.ctx.errors, [])
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {})

    def test_head3(self):
        data = {}
        parse_word_head(self.ctx, "noun", "testpAge", data, False)
        self.assertEqual(self.ctx.errors, [])
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {"forms": [{
                "form": "testpAge",
                "tags": ["canonical"]
            }]})

    def test_head4(self):
        data = {}
        parse_word_head(self.ctx, "noun", "testpage f", data, False)
        self.assertEqual(self.ctx.errors, [])
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {"tags": ["feminine"]})

    def test_head5(self):
        data = {}
        parse_word_head(self.ctx, "noun", "testpAge m", data, False)
        self.assertEqual(self.ctx.errors, [])
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {
            "forms": [
                {
                    "form": "testpAge",
                    "tags": ["canonical", "masculine"]
                },
            ]
        })

    def test_head6(self):
        data = {}
        parse_word_head(self.ctx, "noun", "testpage n", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {"tags": ["neuter"]})

    def test_head7(self):
        data = {}
        parse_word_head(self.ctx, "noun", "testpage c", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {"tags": ["common-gender"]})

    def test_head8(self):
        data = {}
        self.ctx.start_section("Zulu")
        parse_word_head(self.ctx, "noun", "testpage 1", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {"tags": ["class-1"]})

    def test_head8b(self):
        # Trying to parse suffix 1 in English - should not get parsed
        data = {}
        parse_word_head(self.ctx, "noun", "testpage 1", data, False)
        self.assertEqual(self.ctx.errors, [])
        self.assertEqual(self.ctx.warnings, [])
        self.assertNotEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {"forms": [{
                "form": "testpage 1",
                "tags": ["canonical"]
            }]})

    def test_head9(self):
        data = {}
        parse_word_head(self.ctx, "noun",
                        "testpage f (plurale tantum, inanimate)", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {"tags": ["feminine", "inanimate", "plural", "plural-only"]})

    def test_head10(self):
        data = {}
        parse_word_head(
            self.ctx, "noun",
            "testpage f (plurale tantum, stem testpag, inanimate)", data,
            False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {
                "tags": ["feminine", "inanimate", "plural", "plural-only"],
                "forms": [{
                    "tags": ["stem"],
                    "form": "testpag"
                }]
            })

    def test_head11(self):
        data = {}
        parse_word_head(
            self.ctx, "noun",
            "testpage f (plurale tantum, stem testpag, inanimate) "
            "(+ dative)", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        print(data)
        self.assertEqual(
            data, {
                "tags": [
                    "feminine", "inanimate", "plural", "plural-only",
                    "with-dative"
                ],
                "forms": [{
                    "tags": ["stem"],
                    "form": "testpag"
                }]
            })

    def test_head12(self):
        # McCune-Reischauer is used in Korean characters; we're really testing
        # the hyphen in keyword names
        data = {}
        parse_word_head(self.ctx, "noun", "foo (McCune-Reischauer bar)", data,
                        False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {
                "forms": [{
                    "form": "foo",
                    "tags": ["canonical"]
                }, {
                    "form": "bar",
                    "tags": ["McCune-Reischauer"]
                }]
            })

    def test_head13(self):
        data = {}
        parse_word_head(self.ctx, "noun", "testpage f or m", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {"tags": ["feminine", "masculine"]})

    def test_head14(self):
        data = {}
        parse_word_head(self.ctx, "noun", "testpage f, m", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {"tags": ["feminine", "masculine"]})

    def test_head15(self):
        data = {}
        parse_word_head(self.ctx, "noun", "testpage f, m, n", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {"tags": ["feminine", "masculine", "neuter"]})

    def test_head16(self):
        data = {}
        parse_word_head(self.ctx, "noun", "testpage f or m or n", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {"tags": ["feminine", "masculine", "neuter"]})

    def test_head17(self):
        data = {}
        self.ctx.start_page("index")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Noun")
        parse_word_head(self.ctx, "noun", "index n", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {"tags": ["neuter"]})

    def test_head18(self):
        data = {}
        self.ctx.start_page("index")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Noun")
        parse_word_head(self.ctx, "noun",
                        "index m or f (genitive indicis); third declension",
                        data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {
                "tags": ["declension-3", "feminine", "masculine"],
                "forms": [
                    {
                        "tags": ["genitive"],
                        "form": "indicis"
                    },
                ]
            })

    def test_head19(self):
        data = {}
        self.ctx.start_page("index")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Noun")
        parse_word_head(self.ctx, "noun", "foo f or bar m", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {
                "forms": [
                    {
                        "form": "foo",
                        "tags": ["canonical", "feminine"]
                    },
                    {
                        "form": "bar",
                        "tags": ["canonical", "masculine"]
                    },
                ]
            })

    def test_head20(self):
        data = {}
        self.ctx.start_page("index")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Noun")
        parse_word_head(self.ctx, "noun", "foo or bar", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {
                "forms": [
                    {
                        "form": "foo",
                        "tags": ["canonical"]
                    },
                    {
                        "form": "bar",
                        "tags": ["canonical"]
                    },
                ]
            })

    def test_head21(self):
        data = {}
        self.ctx.start_page("index")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Noun")
        parse_word_head(self.ctx, "noun", "foo f or n or bar m or c", data,
                        False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {
                "forms": [
                    {
                        "form": "foo",
                        "tags": ["canonical", "feminine", "neuter"]
                    },
                    {
                        "form": "bar",
                        "tags": ["canonical", "common-gender", "masculine"]
                    },
                ]
            })

    def test_head22(self):
        data = {}
        parse_word_head(self.ctx, "noun", "testpage f or testpage2 m; person",
                        data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {
                "tags": ["person"],
                "forms": [
                    {
                        "tags": ["canonical", "feminine"],
                        "form": "testpage"
                    },
                    {
                        "tags": ["canonical", "masculine"],
                        "form": "testpage2"
                    },
                ]
            })

    def test_head23(self):
        data = {}
        self.ctx.start_page("indubitables")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Adjective")
        parse_word_head(self.ctx, "adj", "indubitables m pl or f pl", data,
                        False)
        # print(json.dumps(data, indent=2))
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data, {"tags": ["feminine", "masculine", "plural"]})

    def test_head24(self):
        data = {}
        self.ctx.start_page("foo")
        self.ctx.start_section("Japanese")
        self.ctx.start_subsection("Noun")
        parse_word_head(self.ctx, "noun", "foo (12 strokes)", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data,
                         {"forms": [
                             {
                                 "tags": ["strokes"],
                                 "form": "12"
                             },
                         ]})

    def test_head25(self):
        data = {}
        self.ctx.start_page("smiley")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Noun")
        parse_word_head(self.ctx, "noun",
                        "smiley m (plural smileys, diminutive smileytje n)",
                        data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {
                "tags": ["masculine"],
                "forms": [
                    {
                        "tags": ["plural"],
                        "form": "smileys"
                    },
                    {
                        "tags": ["diminutive", "neuter"],
                        "form": "smileytje"
                    },
                ]
            })

    def test_head26(self):
        data = {}
        self.ctx.start_page("foos")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Noun")
        parse_word_head(self.ctx, "noun", "foos (plural of foo)", data, False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(data,
                         {"forms": [
                             {
                                 "tags": ["plural-of"],
                                 "form": "foo"
                             },
                         ]})

    def test_head27(self):
        data = {}
        self.ctx.start_page("أَبْلَعَ")
        self.ctx.start_section("Arabic")
        self.ctx.start_subsection("Verb")
        parse_word_head(
            self.ctx, "verb",
            "أَبْلَعَ (ʾablaʿa) IV, non-past يُبْلِعُ‎‎ (yubliʿu)", data,
            False)
        self.assertEqual(self.ctx.warnings, [])
        self.assertEqual(self.ctx.debugs, [])
        self.assertEqual(
            data, {
                "forms": [
                    {
                        "form": "يُبْلِعُ‎‎",
                        "roman": "yubliʿu",
                        "tags": ["non-past"]
                    },
                    {
                        "form": "ʾablaʿa",
                        "tags": ["romanization"]
                    },
                ],
                "tags": ["form-iv"]
            })

    def test_head28(self):
        data = {}
        self.maxDiff = 10000
        self.ctx.start_page("tell")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Noun")
        parse_word_head(
            self.ctx, "noun",
            "tell (third-person singular simple present tells, present participle telling, simple past and past participle told or (dialectal or nonstandard) telled)",
            data, False)
        print(json.dumps(data, indent=2, sort_keys=True))
        self.assertEqual(
            data, {
                "forms": [
                    {
                        "form": "tells",
                        "tags": ["present", "singular", "third-person"]
                    },
                    {
                        "form": "telling",
                        "tags": ["participle", "present"]
                    },
                    {
                        "form": "told",
                        "tags": ["participle", "past"]
                    },
                    {
                        "form": "told",
                        "tags": ["past"]
                    },
                    {
                        "form": "telled",
                        "tags": ["dialectal", "participle", "past"]
                    },
                    {
                        "form": "telled",
                        "tags": ["dialectal", "past"]
                    },
                ],
            })

    def test_head29(self):
        data = {}
        self.maxDiff = 10000
        self.ctx.start_page("take")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Noun")
        parse_word_head(
            self.ctx, "noun",
            "take (third-person singular simple present takes, present participle taking, simple past took, past participle taken or (archaic or Scotland) tane)",
            data, False)
        print(json.dumps(data, indent=2, sort_keys=True))
        self.assertEqual(
            data, {
                "forms": [
                    {
                        "form": "takes",
                        "tags": ["present", "singular", "third-person"]
                    },
                    {
                        "form": "taking",
                        "tags": ["participle", "present"]
                    },
                    {
                        "form": "took",
                        "tags": ["past"]
                    },
                    {
                        "form": "taken",
                        "tags": ["participle", "past"]
                    },
                    {
                        "form": "tane",
                        "tags": ["Scotland", "archaic", "participle", "past"]
                    },
                ],
            })

    def test_head30(self):
        data = {}
        self.maxDiff = 10000
        self.ctx.start_page("burn")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Noun")
        parse_word_head(
            self.ctx, "noun",
            "burn (third-person singular simple present burns, present participle burning, simple past and past participle burned or (mostly Commonwealth) burnt or (obsolete) brent)",
            data, False)
        print(json.dumps(data, indent=2, sort_keys=True))
        self.assertEqual(
            data, {
                "forms": [
                    {
                        "form": "burns",
                        "tags": ["present", "singular", "third-person"]
                    },
                    {
                        "form": "burning",
                        "tags": ["participle", "present"]
                    },
                    {
                        "form": "burned",
                        "tags": ["participle", "past"]
                    },
                    {
                        "form": "burned",
                        "tags": ["past"]
                    },
                    {
                        "form": "burnt",
                        "tags": ["Commonwealth", "participle", "past"]
                    },
                    {
                        "form": "burnt",
                        "tags": ["Commonwealth", "past"]
                    },
                    {
                        "form": "brent",
                        "tags": ["obsolete", "participle", "past"]
                    },
                    {
                        "form": "brent",
                        "tags": ["obsolete", "past"]
                    },
                ],
            })

    def test_head31(self):
        data = {}
        self.maxDiff = 10000
        self.ctx.start_page("grind")
        self.ctx.start_section("English")
        self.ctx.start_subsection("Noun")
        parse_word_head(
            self.ctx, "noun",
            "grind (third-person singular simple present grinds, present participle grinding, simple past and past participle ground or grinded) (see usage notes below)",
            data, False)
        print(json.dumps(data, indent=2, sort_keys=True))
        self.assertEqual(
            data, {
                "forms": [
                    {
                        "form": "grinds",
                        "tags": ["present", "singular", "third-person"]
                    },
                    {
                        "form": "grinding",
                        "tags": ["participle", "present"]
                    },
                    {
                        "form": "ground",
                        "tags": ["participle", "past"]
                    },
                    {
                        "form": "ground",
                        "tags": ["past"]
                    },
                    {
                        "form": "grinded",
                        "tags": ["participle", "past"]
                    },
                    {
                        "form": "grinded",
                        "tags": ["past"]
                    },
                ],
            })

    def test_head32(self):
        data = {}
        self.maxDiff = 10000
        self.ctx.start_page("rive")
        self.ctx.start_section("Danish")
        self.ctx.start_subsection("Noun")
        parse_word_head(
            self.ctx, "noun",
            "rive (past tense rev, past participle revet, common gender attributive reven, plural or definite attributive revne)",
            data, False)
        print(json.dumps(data, indent=2, sort_keys=True))
        self.assertEqual(
            data, {
                "forms": [
                    {
                        "form": "rev",
                        "tags": ["past"]
                    },
                    {
                        "form": "revet",
                        "tags": ["participle", "past"]
                    },
                    {
                        "form":
                        "reven",
                        "tags":
                        ["attributive", "common-gender", "participle", "past"]
                    },
                    {
                        "form":
                        "revne",
                        "tags": [
                            "attributive", "definite", "participle", "past",
                            "singular"
                        ]
                    },
                    {
                        "form": "revne",
                        "tags":
                        ["attributive", "participle", "past", "plural"]
                    },
                ],
            })