manual merge
This commit is contained in:
commit
616c5dba59
5
tfidf.py
5
tfidf.py
@ -146,7 +146,8 @@ def request_results(query):
|
||||
# make a list of sentences that contain the query word
|
||||
# and shape results object
|
||||
for x, manifesto in results.items():
|
||||
value = manifesto['tfidf'] * 10000
|
||||
sents = sentences[manifesto['name']]
|
||||
value = manifesto['tfidf'] * 50000
|
||||
result_sentences = []
|
||||
count = 0
|
||||
for s in manifesto['sentences']:
|
||||
@ -156,7 +157,7 @@ def request_results(query):
|
||||
if count < 3: # set to include a max 3 results/manifesto in the results list
|
||||
count += 1
|
||||
if done is not 'yes':
|
||||
sentence = s.replace(query, '<strong style="font-size:{}px;">{}</strong>'.format(value, query))
|
||||
sentence = s.replace(query, '<strong style="font-size:{}%;">{}</strong>'.format(100 + value, query))
|
||||
html = Markup(sentence)
|
||||
if count == 3:
|
||||
html = html + Markup('<div id="more">(...)<sup>*</sup></div>')
|
||||
|
Loading…
Reference in New Issue
Block a user