Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
def main():
|
| 4 |
+
st.title("Shorthand Notation App")
|
| 5 |
+
st.write("Convert text to shorthand notation and vice versa.")
|
| 6 |
+
|
| 7 |
+
option = st.selectbox("Select an option:", ("Text to Shorthand", "Shorthand to Text"))
|
| 8 |
+
|
| 9 |
+
if option == "Text to Shorthand":
|
| 10 |
+
text_input = st.text_area("Enter text to convert:")
|
| 11 |
+
if st.button("Convert"):
|
| 12 |
+
shorthand_output = text_to_shorthand(text_input)
|
| 13 |
+
st.write("**Shorthand Notation:**")
|
| 14 |
+
st.code(shorthand_output)
|
| 15 |
+
|
| 16 |
+
elif option == "Shorthand to Text":
|
| 17 |
+
shorthand_input = st.text_area("Enter shorthand to convert:")
|
| 18 |
+
if st.button("Convert"):
|
| 19 |
+
text_output = shorthand_to_text(shorthand_input)
|
| 20 |
+
st.write("**Converted Text:**")
|
| 21 |
+
st.code(text_output)
|
| 22 |
+
|
| 23 |
+
def text_to_shorthand(text):
|
| 24 |
+
# Placeholder for shorthand conversion logic
|
| 25 |
+
# Replace with real implementation
|
| 26 |
+
return "".join([word[0] for word in text.split()])
|
| 27 |
+
|
| 28 |
+
def shorthand_to_text(shorthand):
|
| 29 |
+
# Placeholder for shorthand-to-text logic
|
| 30 |
+
# Replace with real implementation
|
| 31 |
+
return "[Expanded Text Based on Logic]"
|
| 32 |
+
|
| 33 |
+
if __name__ == "__main__":
|
| 34 |
+
main()
|