{# This template is also rendered with each entry (i.e., `rendered_templates`), and has access to all of the main entry-specific template values. #} {% block template_doc %}{% if TEMPLATE_DOC %} The following customizations have been made: - Display the lexicon entry stem along with the lemma (√root). - Some customizations in `crk.py` and `crk_tags.py` relate to this. - If a tag is PV, wrap it with tooltip markup to display the definition - twitter bootstrap tooltips js included {% endif %}{% endblock %} {%- import "lexicon.macros" as macros with context -%} {%- import "korp.macros" as korp with context -%} {%- macro render_tag_piece(tag, tooltip) -%} {%- if tooltip -%} {{ tag }} {%- else -%} {{ tag }} {%- endif -%} {% endmacro %} {%- macro render_tag(formatted) -%} {%- for tag, tooltip in formatted -%}{%- if not tag %}{% continue -%}{% endif -%} {{ render_tag_piece(tag, tooltip) }}{% if not loop.last %} + {% endif %} {% endfor %} {% endmacro %}
{% if lexicon_entry %} {% set stem_d = lexicon_entry.xpath('./lg/stem/text()')|first %} {% set lem = lexicon_entry.xpath('./lg/l/text()')|first %} {% set stem = stem_d or lem %} {% else %} {% set stem = False %} {% endif %} {% for grouper, forms in analyses|groupby('lemma') %} {# nikî-nitawi-kiskinwahamâkosin ⟵ PV/nitawi + √ kiskinwahamâkosi- + Intransitive Animate Verb + Independent + Past + 1s #} {% for lemmagroup, lemmafs in forms|groupby('pos') %} {# TODO: generate grouper with tag #} {% set grouper_or_generated = grouper %} {% if lemmafs|length > 0 %} {% set first_f = lemmafs|first %} {# TODO: why is this not in the order we need it? maybe use tagsets to slide thes to the front? #} {% set first_tag = first_f.tag %} {# TODO: Problem here is that forms can't be generated since tag is formatted wrong, but wrong error is returned. #} {% set generated, log_data = grouper|generate_or_not(_from, first_tag, lexicon_entry) %} {% if generated %} {% set grouper_or_generated = generated|first %} {% else %} {% set grouper_or_generated = user_input %} {% endif %} {% endif %}
{{ grouper_or_generated }}
{% if log_data -%}{{ log_data|console_log }}{%- endif %} {% endfor %} {% endfor %}
{# vim: set ts=4 sw=4 tw=0 wrapmargin=0 syntax=htmljinja : #}