awacke1 commited on
Commit
76cca73
·
verified ·
1 Parent(s): 44d6790

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -18
app.py CHANGED
@@ -101,24 +101,12 @@ roleplaying_glossary = {
101
  }
102
 
103
 
104
- # Function to search within the roleplaying glossary and display results
105
- def search_glossary(query, roleplaying_glossary):
106
- found = False
107
- for category, details in roleplaying_glossary.items():
108
- for game, terms in details.items():
109
- if query.lower() in ' '.join(terms).lower():
110
- if not found:
111
- st.markdown(f"#### Results for '{query}'")
112
- found = True
113
- st.markdown(f"**{category} -> {game}:**")
114
- for term in terms:
115
- if query.lower() in term.lower():
116
- st.write(f"- {term}")
117
-
118
- if not found:
119
- st.write("No results found.")
120
 
121
-
122
  st.write('## ' + query)
123
 
124
  all=""
@@ -143,7 +131,7 @@ def search_glossary(query, roleplaying_glossary):
143
 
144
  SpeechSynthesis(all)
145
  return all
146
-
147
 
148
  # Function to display the glossary in a structured format
149
  def display_glossary(glossary, area):
 
101
  }
102
 
103
 
104
+ def search_glossary(query):
105
+ for category, terms in roleplaying_glossary.items():
106
+ if query.lower() in (term.lower() for term in terms):
107
+ st.markdown(f"#### {category}")
108
+ st.write(f"- {query}")
 
 
 
 
 
 
 
 
 
 
 
109
 
 
110
  st.write('## ' + query)
111
 
112
  all=""
 
131
 
132
  SpeechSynthesis(all)
133
  return all
134
+
135
 
136
  # Function to display the glossary in a structured format
137
  def display_glossary(glossary, area):