Browse Source

added the '(...)' sign to result lists

master
mb@mb 6 years ago
parent
commit
8fe9eb912f
  1. 9
      static/css/stylesheet.css
  2. 2
      templates/base.html
  3. 5
      templates/results.html
  4. 2
      tfidf.py

9
static/css/stylesheet.css

@ -53,6 +53,15 @@ h1, h2, h3{
.result{
margin:10px 0 0 0;
}
#more{
margin:10px 0;
}
#more-descr{
margin:10px 0;
}
#more sup{
color:#800000;
}
.sentence{
margin:10px 0 0 0;
}

2
templates/base.html

@ -23,6 +23,8 @@
<li>{{txt}}</li>
{% endfor %}
<ul>
{% block txtlist %}
{% endblock %}
</div>
{% block results %}
{% endblock %}

5
templates/results.html

@ -1,5 +1,10 @@
{% extends "base.html" %}
{% block title %}{{query}}{% endblock %}
{% block txtlist %}
<div id="more-descr">[*] The algorithm is asked to not return more than 3 sentences from the same manifesto. There are more sentences that match this search query!</div>
{% endblock %}
{% block results %}
<h1>The results for the query "{{query}}" are:</h1>
<div id="results">

2
tfidf.py

@ -137,6 +137,8 @@ def request_results(query):
if done is not 'yes':
sentence = s.replace(query, '<strong style="font-size:{}px;">{}</strong>'.format(value, query))
html = Markup(sentence)
if count == 3:
html = html + Markup('<div id="more">(...)<sup>*</sup></div>')
result_sentences.append(html)
done = 'yes'
results[x]['sentences'] = result_sentences

Loading…
Cancel
Save