{# This is the paradigm template for North Sámi. * Nouns: Display everything in the paradigm in a definition list * Verbs: Display a table with one column for present tense, and one for preterite tense; then display a separate definition list for nonfinite forms. For the negative verb and supinum negative verb, we also add a title on the table. - These are controlled by tagsets. Including more forms for verbs can be handled by adding more tags to the file `tagsets/sma.tagset` #} {%- set first_l = lexicon_entry|xpath('lg/l')|first %} {% set lemma = first_l|text %} {% set pos = first_l|xpath('@pos')|first %} {% set has_forms = paradigm and paradigm|length > 0 -%} {% set paradigm_exists = paradigm|length > 0 %} {%- if pos|upper == 'V' %} {% set verbs = true %} {% set present_verbs = paradigm|by_tagset_value("tense", "Prs") |without_tagset("negation") |group_by_tag %} {% set preterite_verbs = paradigm|by_tagset_value("tense", "Prt") |without_tagset("negation") |group_by_tag %} {% set nonfinite_forms = paradigm|by_tagset("nonfinite_paradigm") %} {# As long as the paradigm files are in order, this will zip accurately. If not we need to manually select each form and display it. #} {# Use izip_longest to fill in the extra blanks spaces when one list ends first #} {% set zipped_verbs = izip_longest(present_verbs, preterite_verbs, fillvalue='-')|list %} {% set paradigm_exists = zipped_verbs|length > 0 or nonfinite_forms|length > 0 %} {# strip some parts of the tags that we don't need #} {% set prs_text = "Prs"|tagfilter(_from, _to) %} {% set prt_text = "Prt"|tagfilter(_from, _to) %} {% set conneg_text = "ConNeg"|tagfilter(_from, _to) %} {% set verb_text = "V"|tagfilter(_from, _to) %} {% set verb_text_ind = "Ind"|tagfilter(_from, _to) %} {% set sup_text = "Sup"|tagfilter(_from, _to) %} {% set neg_text = "Neg"|tagfilter(_from, _to) %} {% set nonfinite_header = False %} {% set is_supinum = nonfinite_forms|by_tagset("supinum")|length > 0 %} {# we'll know this isn't just a normal verb with a couple negative forms because there are 9 #} {% set is_negative = nonfinite_forms|by_tagset("negative")|length == 9 %} {% if is_supinum and is_negative %} {% set nonfinite_header = sup_text + " " + neg_text %} {% endif %} {% if is_negative and not is_supinum %} {% set nonfinite_header = neg_text %} {% endif %} {% macro clean_tag(tag_input) -%} {% set filtered_tag = tag_input|tagfilter(_from, _to) %} {% if nonfinite_header and (is_supinum or is_negative) %} {% set filtered_tag = filtered_tag|replace(sup_text, "") |replace(neg_text, "") %} {% endif %} {% if conneg_text in filtered_tag %} {{ filtered_tag|replace(verb_text, "") |replace(verb_text_ind, "") }} {% else %} {{ filtered_tag|replace(prs_text, "") |replace(prt_text, "") |replace(verb_text, "") |replace(verb_text_ind, "") }} {% endif %} {%- endmacro %} {%- endif %} {%- if pos|upper == 'N' or pos|upper == 'NUM' %} {% set sg_forms = paradigm|by_tagset_value("number", "Sg")|group_by_tag %} {% set pl_forms = paradigm|by_tagset_value("number", "Pl")|group_by_tag %} {# Use izip_longest to fill in the extra blanks spaces when one list ends first #} {% set zipped_numbers = izip_longest(sg_forms, pl_forms, fillvalue='-')|list %} {% set paradigm_exists = zipped_numbers|length > 0 %} {% set numberless_forms = paradigm|by_tagset("nominals_null_number") %} {% set sg_text = "Sg"|tagfilter(_from, _to) %} {% set pl_text = "Pl"|tagfilter(_from, _to) %} {% if pos|upper == 'N' %} {% set pos_text = pos|upper|tagfilter(_from, _to) %} {% elif pos|upper == 'NUM' %} {% set pos_text = 'Num'|tagfilter(_from, _to) %} {% endif %} {% macro clean_tag(tag_input) %} {{ tag_input|tagfilter(_from, _to) |replace(pos_text, "") |replace(sg_text, "") |replace(pl_text, "") }} {% endmacro %} {% endif -%} {%- if pos|upper == 'A' %} {% set adj_text = "A"|tagfilter(_from, _to) %} {% macro clean_tag(tag_input) %} {{ tag_input|tagfilter(_from, _to) |replace(adj_text, "") }} {% endmacro %} {% endif -%} {%- if pos|upper == 'PRON' %} {% set pron_text = "Pron"|tagfilter(_from, _to) %} {% set indef_text = "Indef"|tagfilter(_from, _to) %} {% set sg_text = "Sg"|tagfilter(_from, _to) %} {% set pl_text = "Pl"|tagfilter(_from, _to) %} {% set pron_type = lexicon_entry|xpath('./lg/l/@type')|first %} {% set pron_type_text = pron_type|tagfilter(_from, _to) %} {# If there are nomainal number markings, then we'll split these into two columns. Must determine this by checking the tagsets. Works for words like eará, soames, etc. TODO: mii +Rel gii +Rel makkár +Rel / +Interr dat nr="Sg", type="Dem" dat nr="Pl", type="Dem" recipr is broken /detail/sme/nob/goabbat%20guoimmisteame.html #} {% set two_columns = False %} {% set sg_forms = paradigm|by_tagset_value("number", "Sg")|group_by_tag %} {% set pl_forms = paradigm|by_tagset_value("number", "Pl")|group_by_tag %} {% if sg_forms|length > 0 and pl_forms|length > 0 %} {% set two_columns = True %} {% set zipped_numbers = izip_longest(sg_forms, pl_forms, fillvalue='-')|list %} {% set numberless_forms = paradigm|by_tagset("nouns_null_number") %} {% endif %} {% macro clean_tag(tag_input) %} {% if two_columns %} {{ tag_input|tagfilter(_from, _to) |replace(pron_text, "") |replace(sg_text, "") |replace(pl_text, "") |replace(pron_type_text, "") }} {% else %} {{ tag_input|tagfilter(_from, _to) |replace(pron_text, "") |replace(pron_type_text, "") }} {% endif %} {% endmacro %} {% endif -%} {%- macro full_paradigm_link() %} {%- trans -%}Full paradigm{%- endtrans -%} → {% endmacro -%} {%- if has_forms %} {%- if pos|upper == 'V' %} {% if paradigm_exists %} {% if zipped_verbs %}
{{ prs_text }} (daan biejjien) | {{ prt_text }} (jååktan) | |||
---|---|---|---|---|
{{ tag_display }} | {% if present_forms and present_forms != '-' %}{{ present_forms|join(' ', attribute='form') }} |
{% else %}
— | {% endif %} {% if preterite_forms and preterite_forms != '-' %}{{ preterite_forms|join(' ', attribute='form') }} |
{% else %}
— | {% endif %}
{{ sg_text }} | {{ pl_text }} | |||
---|---|---|---|---|
{{ tag_display }} | {% if sgs and sgs != '-' %}{{ sgs|join(' ', attribute='form') }} |
{% else %}
— | {% endif %} {% if pls and pls != '-' %}{{ pls|join(' ', attribute='form') }} |
{% else %}
— | {% endif %}
{{ clean_tag(var[0].tag) }} | {% endif %}{{ var|join(' ', attribute='form') }} |
{{ sg_text }} | {{ pl_text }} | |||
---|---|---|---|---|
{{ tag_display }} | {% if sgs and sgs != '-' %}{{ sgs|join(' ', attribute='form') }} |
{% else %}
— | {% endif %} {% if pls and pls != '-' %}{{ pls|join(' ', attribute='form') }} |
{% else %}
— | {% endif %}
{{ clean_tag(var[0].tag) }} | {% endif %}{{ var|join(' ', attribute='form') }} |