Shorthand / app.py
Engineer786's picture
Update app.py
2044c26 verified
import streamlit as st
# Placeholder for conversion logic
def text_to_shorthand(text):
# Simple mapping for demonstration (expand with Pitman rules)
shorthand_dict = {
"and": "∧",
"the": "⬤",
"of": "→",
"is": "∥",
"to": "↘",
}
words = text.split()
shorthand = " ".join(shorthand_dict.get(word, word) for word in words)
return shorthand
def main():
st.title("Shorthand Writing App")
st.write("Convert text to Pitman shorthand writing.")
option = st.selectbox("Select an option:", ("Learn Shorthand", "Convert Text"))
if option == "Learn Shorthand":
st.write("### Shorthand Basics")
st.write("Here, you can learn the basics of shorthand writing techniques and symbols.")
st.markdown("- **∧**: Represents 'and'\n- **⬤**: Represents 'the'\n- Expand this with more shorthand symbols.")
elif option == "Convert Text":
text_input = st.text_area("Enter text to convert into shorthand:")
if st.button("Convert"):
shorthand_output = text_to_shorthand(text_input)
st.write("### Shorthand Writing")
st.code(shorthand_output)
if __name__ == "__main__":
main()