ola13 commited on
Commit
31a66c1
1 Parent(s): 6c25d13
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -109,12 +109,21 @@ def process_exact_match_payload(payload, query):
109
  text = result["text"]
110
  print(result, text, type(text))
111
  meta_html = format_meta(result)
112
- result_html = """<br><hr><br>""" + meta_html
113
  query_start = text.find(query)
114
  query_end = query_start + len(query)
115
- result_html += text[0:query_start]
116
- result_html += "<b>{}</b>".format(text[query_start:query_end])
117
- result_html += text[query_end:]
 
 
 
 
 
 
 
 
 
118
  results_html += result_html
119
  return results_html + "<hr>"
120
 
 
109
  text = result["text"]
110
  print(result, text, type(text))
111
  meta_html = format_meta(result)
112
+
113
  query_start = text.find(query)
114
  query_end = query_start + len(query)
115
+ tokens_html = text[0:query_start]
116
+ tokens_html += "<b>{}</b>".format(text[query_start:query_end])
117
+ tokens_html += text[query_end:]
118
+ result_html = (
119
+ meta_html
120
+ + """
121
+ <p style='font-family: Arial;'>{}</p>
122
+ <br>
123
+ """.format(
124
+ tokens_html
125
+ )
126
+ )
127
  results_html += result_html
128
  return results_html + "<hr>"
129