Engineer786 commited on
Commit
2044c26
·
verified ·
1 Parent(s): 469e50c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -9
app.py CHANGED
@@ -1,22 +1,36 @@
1
  import streamlit as st
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  def main():
4
  st.title("Shorthand Writing App")
5
- st.write("Practice and explore shorthand writing.")
6
 
7
- option = st.selectbox("Select an option:", ("Learn Shorthand", "Practice Writing"))
8
 
9
  if option == "Learn Shorthand":
10
  st.write("### Shorthand Basics")
11
  st.write("Here, you can learn the basics of shorthand writing techniques and symbols.")
12
- st.markdown("- **Symbol A**: Represents 'and'\n- **Symbol B**: Represents 'the'")
13
- st.write("Expand this section with more shorthand rules and examples.")
14
 
15
- elif option == "Practice Writing":
16
- text_input = st.text_area("Enter text to practice shorthand writing:")
17
- if st.button("Submit"):
18
- st.write("### Your Shorthand Practice")
19
- st.write("Start practicing your shorthand writing for the entered text.")
 
20
 
21
  if __name__ == "__main__":
22
  main()
 
1
  import streamlit as st
2
 
3
+ # Placeholder for conversion logic
4
+ def text_to_shorthand(text):
5
+ # Simple mapping for demonstration (expand with Pitman rules)
6
+ shorthand_dict = {
7
+ "and": "∧",
8
+ "the": "⬤",
9
+ "of": "→",
10
+ "is": "∥",
11
+ "to": "↘",
12
+ }
13
+ words = text.split()
14
+ shorthand = " ".join(shorthand_dict.get(word, word) for word in words)
15
+ return shorthand
16
+
17
  def main():
18
  st.title("Shorthand Writing App")
19
+ st.write("Convert text to Pitman shorthand writing.")
20
 
21
+ option = st.selectbox("Select an option:", ("Learn Shorthand", "Convert Text"))
22
 
23
  if option == "Learn Shorthand":
24
  st.write("### Shorthand Basics")
25
  st.write("Here, you can learn the basics of shorthand writing techniques and symbols.")
26
+ st.markdown("- ****: Represents 'and'\n- ****: Represents 'the'\n- Expand this with more shorthand symbols.")
 
27
 
28
+ elif option == "Convert Text":
29
+ text_input = st.text_area("Enter text to convert into shorthand:")
30
+ if st.button("Convert"):
31
+ shorthand_output = text_to_shorthand(text_input)
32
+ st.write("### Shorthand Writing")
33
+ st.code(shorthand_output)
34
 
35
  if __name__ == "__main__":
36
  main()