azaninello commited on
Commit
fa71355
1 Parent(s): 7de2177

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,11 +32,11 @@ def search_engine(target):
32
  return f"Non ho trovato la parola '{target}' nei testi.\n"
33
 
34
  stringed_results = ''
35
- for r in result:
36
- stringed_results += str(r) + '\n'
37
 
38
  else:
39
- return f"""Ho trovato {len(result)} {"frasi" if len(result) > 1 else "frase"} in cui è presente la parola {target}.\n {stringed_results}"""
40
 
41
  demo = gr.Interface(fn=search_engine, inputs='text', outputs='text')
42
  demo.launch()
 
32
  return f"Non ho trovato la parola '{target}' nei testi.\n"
33
 
34
  stringed_results = ''
35
+ for n,r in enumerate(result):
36
+ stringed_results += str(n+1+ ': ' + str(r) + '\n\n'
37
 
38
  else:
39
+ return f"""Ho trovato {len(result)} {"frasi" if len(result) > 1 else "frase"} in cui è presente la parola {target}.\n\n {stringed_results}"""
40
 
41
  demo = gr.Interface(fn=search_engine, inputs='text', outputs='text')
42
  demo.launch()