Bofandra commited on
Commit
bacf5e3
1 Parent(s): fdef0fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -56,14 +56,17 @@ def find(query):
56
  #results = results + result_quran['text'].item()+" (Q.S "+str(result['sura']).rstrip('.0')+":"+str(result['aya']).rstrip('.0')+")\n"
57
  i=i+1
58
 
59
- results['text'] = results['text'] + '#' + 'https://quran.com/'+results['sura'].astype(str)+':'+results['aya'].astype(str)+'/tafsirs/en-tafisr-ibn-kathir'
 
 
 
60
  results = results.style.format({'text': make_clickable_both})
61
 
62
  #return sorted_quran
63
  return results
64
 
65
- demo = gr.Interface(fn=find, inputs="textbox", outputs=gr.Dataframe(headers=['sura', 'aya', 'text'],wrap=True))
66
  #demo = gr.Interface(fn=find, inputs="textbox", outputs="textbox")
67
 
68
  if __name__ == "__main__":
69
- demo.launch(share=True)
 
56
  #results = results + result_quran['text'].item()+" (Q.S "+str(result['sura']).rstrip('.0')+":"+str(result['aya']).rstrip('.0')+")\n"
57
  i=i+1
58
 
59
+ url = 'https://quran.com/'+results['sura'].astype(str)+':'+results['aya'].astype(str)+'/tafsirs/en-tafisr-ibn-kathir'
60
+ results['text'] = '<a href="{'+url+'}">{'+results['text']+'}</a>'
61
+ #results['text'] = results['text'] + '#' + 'https://quran.com/'+results['sura'].astype(str)+':'+results['aya'].astype(str)+'/tafsirs/en-tafisr-ibn-kathir'
62
+
63
  results = results.style.format({'text': make_clickable_both})
64
 
65
  #return sorted_quran
66
  return results
67
 
68
+ demo = gr.Interface(fn=find, inputs="textbox", outputs=gr.Dataframe(headers=['sura', 'aya', 'text'],datatype=["str", "str", "markdown"],wrap=True))
69
  #demo = gr.Interface(fn=find, inputs="textbox", outputs="textbox")
70
 
71
  if __name__ == "__main__":
72
+ demo.launch()