awacke1 commited on
Commit
96034a4
1 Parent(s): a6aee6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -53,6 +53,22 @@ transhuman_glossary = {
53
  "👽 Terrorists": ["Bioengineered Virus Spreaders🧬💉", "Nanotechnology Saboteurs🔬🧨", "Cyber Terrorist Networks💻🔥", "Rogue AI Sects🤖🛑", "Space Anarchist Cells🚀Ⓐ", "Quantum Data Hijackers💻🔓", "Environmental Extremists🌍💣", "Technological Singularity Cults🤖🙏", "Interspecies Supremacists👽👑", "Orbital Bombardment Threats🛰️💥"],
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  # Display the glossary with Streamlit components, ensuring emojis are used
57
  def display_glossary(area):
58
  st.subheader(f"📘 Glossary for {area}")
 
53
  "👽 Terrorists": ["Bioengineered Virus Spreaders🧬💉", "Nanotechnology Saboteurs🔬🧨", "Cyber Terrorist Networks💻🔥", "Rogue AI Sects🤖🛑", "Space Anarchist Cells🚀Ⓐ", "Quantum Data Hijackers💻🔓", "Environmental Extremists🌍💣", "Technological Singularity Cults🤖🙏", "Interspecies Supremacists👽👑", "Orbital Bombardment Threats🛰️💥"],
54
  }
55
 
56
+
57
+ # Function to search glossary and display results
58
+ def search_glossary(query):
59
+ for category, terms in transhuman_glossary.items():
60
+ if query.lower() in (term.lower() for term in terms):
61
+ st.markdown(f"### {category}")
62
+ st.write(f"- {query}")
63
+
64
+ # Display instructions and handle query parameters
65
+ st.markdown("## Glossary Lookup\nEnter a term in the URL query, like `?q=Nanotechnology` or `?query=Martian Syndicate`.")
66
+ query_params = st.experimental_get_query_params()
67
+ query = (query_params.get('q') or query_params.get('query') or [''])[0]
68
+ if query: search_glossary(query)
69
+
70
+
71
+
72
  # Display the glossary with Streamlit components, ensuring emojis are used
73
  def display_glossary(area):
74
  st.subheader(f"📘 Glossary for {area}")