Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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("
|
| 6 |
|
| 7 |
-
option = st.selectbox("Select an option:", ("Learn Shorthand", "
|
| 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("- **
|
| 13 |
-
st.write("Expand this section with more shorthand rules and examples.")
|
| 14 |
|
| 15 |
-
elif option == "
|
| 16 |
-
text_input = st.text_area("Enter text to
|
| 17 |
-
if st.button("
|
| 18 |
-
|
| 19 |
-
st.write("
|
|
|
|
| 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()
|