awacke1 commited on
Commit
77129c9
1 Parent(s): 6e95e4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -17
app.py CHANGED
@@ -93,22 +93,11 @@ roleplaying_glossary = {
93
  }
94
 
95
 
96
- # Function to search within the roleplaying glossary and display results
97
- def search_glossary(query, roleplaying_glossary):
98
- found = False
99
- for category, details in roleplaying_glossary.items():
100
- for game, terms in details.items():
101
- if query.lower() in ' '.join(terms).lower():
102
- if not found:
103
- st.markdown(f"#### Results for '{query}'")
104
- found = True
105
- st.markdown(f"**{category} -> {game}:**")
106
- for term in terms:
107
- if query.lower() in term.lower():
108
- st.write(f"- {term}")
109
-
110
- if not found:
111
- st.write("No results found.")
112
 
113
  st.write('## ' + query)
114
 
@@ -134,7 +123,7 @@ def search_glossary(query, roleplaying_glossary):
134
 
135
  SpeechSynthesis(all)
136
  return all
137
-
138
 
139
  # Function to display the glossary in a structured format
140
  def display_glossary(glossary, area):
 
93
  }
94
 
95
 
96
+ def search_glossary(query):
97
+ for category, terms in roleplaying_glossary.items():
98
+ if query.lower() in (term.lower() for term in terms):
99
+ st.markdown(f"#### {category}")
100
+ st.write(f"- {query}")
 
 
 
 
 
 
 
 
 
 
 
101
 
102
  st.write('## ' + query)
103
 
 
123
 
124
  SpeechSynthesis(all)
125
  return all
126
+
127
 
128
  # Function to display the glossary in a structured format
129
  def display_glossary(glossary, area):