awacke1 commited on
Commit
4293602
Β·
1 Parent(s): 2ad6a1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +60 -0
app.py CHANGED
@@ -1,4 +1,64 @@
1
  import streamlit as st
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  st.markdown("""
3
 
4
 
 
1
  import streamlit as st
2
+
3
+
4
+ # Import necessary libraries
5
+ import xml.etree.ElementTree as ET
6
+
7
+ # Mathematical principles and corresponding emojis
8
+ principles = {
9
+ "Permutations_and_Combinations": {"emoji": "πŸ”’", "name": "Permutations and Combinations"},
10
+ "Pigeonhole_Principle": {"emoji": "πŸ•ŠοΈ", "name": "Pigeonhole Principle"},
11
+ "Graph_Theory": {"emoji": "πŸ“Š", "name": "Graph Theory"},
12
+ "Inclusion_Exclusion_Principle": {"emoji": "βž•βž–", "name": "Inclusion-Exclusion Principle"},
13
+ "Binomial_Coefficients": {"emoji": "πŸ”£", "name": "Binomial Coefficients"},
14
+ "Partition_Theory": {"emoji": "πŸ”€", "name": "Partition Theory"},
15
+ "Generating_Functions": {"emoji": "πŸ”„", "name": "Generating Functions"},
16
+ "Recurrence_Relations": {"emoji": "πŸ”„βž‘οΈ", "name": "Recurrence Relations"},
17
+ "Combinatorial_Proofs": {"emoji": "βœ…", "name": "Combinatorial Proofs"},
18
+ "Catalan_Numbers": {"emoji": "πŸ”€πŸ”’", "name": "Catalan Numbers"},
19
+ }
20
+
21
+ # Parsing CCDA XML
22
+ def parse_ccda(xml_file):
23
+ # Parse XML using ElementTree
24
+ tree = ET.parse(xml_file)
25
+ root = tree.getroot()
26
+
27
+ # Process each element in XML
28
+ for elem in root:
29
+ # Processing code here...
30
+ pass
31
+
32
+ # Creating hyperlinks to Wikipedia and NLM
33
+ def create_hyperlinks(principle_key):
34
+ base_wiki_url = "https://en.wikipedia.org/wiki/"
35
+ base_nlm_url = "https://www.nlm.nih.gov/mesh/"
36
+
37
+ # Concatenate base URL with principle key for the hyperlink
38
+ wiki_url = base_wiki_url + principle_key.replace("_", " ")
39
+ nlm_url = base_nlm_url + principle_key.replace("_", " ")
40
+
41
+ return wiki_url, nlm_url
42
+
43
+ # Displaying each mathematical principle with unique keys, emojis, and names
44
+ for key in principles.keys():
45
+ # Get the name and emoji
46
+ name = principles[key]["name"]
47
+ emoji = principles[key]["emoji"]
48
+
49
+ # Get the hyperlinks
50
+ wiki_url, nlm_url = create_hyperlinks(key)
51
+
52
+ # Display the principle
53
+ print(f"{emoji} {name}")
54
+ print(f"Wikipedia link: {wiki_url}")
55
+ print(f"NLM link: {nlm_url}\n")
56
+
57
+
58
+
59
+
60
+
61
+
62
  st.markdown("""
63
 
64