Commit 8f599165 authored by Anze Vavpetic's avatar Anze Vavpetic

term viewer now also displays the canonical form

parent e09fc779
<div id="widgetvisualization-{{widget.pk}}" rel="{{widget.pk}}" class="widgetvisualizationdialog" title="{{widget.name}} visualization" width="450px">
<div style="width:600px;white-space:pre-wrap;font-family:monospace;">
<pre style="width:600px !important;white-space:pre-wrap">
<table class="datasetTable">
<tr>
<th class="tablecellcenter">Score</th>
<th class="tablecellcenter">Term</th>
</tr>
{% for term in terms %}
<tr class="tablerow">
<td class="tablecellright">{{term.score}}</td>
<td class="tablecellleft">{{term.cand}}</td>
</tr>
{% endfor %}
</table>
</pre>
<div id="widgetvisualization-{{widget.pk}}" rel="{{widget.pk}}" class="widgetvisualizationdialog" title="{{widget.name}} visualization" width="650px">
<div style="width:600px;white-space:pre-wrap;font-family:monospace;">
<pre style="width:600px !important;white-space:pre-wrap">
<table class="datasetTable">
<tr>
<th class="tablecellcenter">Score</th>
<th class="tablecellcenter">Term</th>
<th class="tablecellcenter">Canonical</th>
</tr>
{% for term in terms %}
<tr class="tablerow">
<td class="tablecellright">{{term.score}}</td>
<td class="tablecellleft">{{term.cand}}</td>
<td class="tablecellleft">{{term.lemma}}</td>
</tr>
{% endfor %}
</table>
</pre>
</div>
</div>
</div>
\ No newline at end of file
......@@ -30,7 +30,7 @@ def term_candidate_viewer(request, input_dict, output_dict, widget):
continue
terms.append({'score' : score,
'cand' : cand.replace('[', '').replace(']',''),
#'lemma' : lemma.replace('<<', '').replace('>>','')
'lemma' : lemma.replace('<<', '').replace('>>','')
})
terms = sorted(terms, key = lambda x: x['score'], reverse=True)
return render(request, 'visualizations/terms.html', {'widget' : widget, 'terms' : terms})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment