Commit
·
172800a
1
Parent(s):
8d82fc7
adding Hungarian tab
Browse files
app.py
CHANGED
@@ -20,8 +20,8 @@ def random_sentence(lang):
|
|
20 |
return str(translator.translate(sentence,dest=lang).text) #Translates the sentence to target language
|
21 |
|
22 |
|
23 |
-
|
24 |
-
tab1, tab3, tab4= st.tabs(["Polish/Polski", "Turkish/Türkçe", "Serbo-Croatian-Bosnian"])
|
25 |
# tab1, tab2, tab3 = st.tabs(["Polish/Polski", "Hungarian/Magyar", "Turkish/Türkçe"])
|
26 |
|
27 |
with tab1:
|
@@ -49,29 +49,29 @@ with tab1:
|
|
49 |
else:
|
50 |
st.warning("Please enter a string.")
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
|
76 |
with tab3:
|
77 |
|
|
|
20 |
return str(translator.translate(sentence,dest=lang).text) #Translates the sentence to target language
|
21 |
|
22 |
|
23 |
+
tab1, tab2, tab3, tab4= st.tabs(["Polish/Polski", "Hungarian/Magyar", "Turkish/Türkçe", "Serbo-Croatian-Bosnian"])
|
24 |
+
# tab1, tab3, tab4= st.tabs(["Polish/Polski", "Turkish/Türkçe", "Serbo-Croatian-Bosnian"])
|
25 |
# tab1, tab2, tab3 = st.tabs(["Polish/Polski", "Hungarian/Magyar", "Turkish/Türkçe"])
|
26 |
|
27 |
with tab1:
|
|
|
49 |
else:
|
50 |
st.warning("Please enter a string.")
|
51 |
|
52 |
+
with tab2:
|
53 |
+
st.header("Hungarian Transliteration")
|
54 |
+
input_string_hungarian = st.text_area("Enter a Hungarian word/sentence to transliterate:")
|
55 |
+
hungarian_examples = ['Köszönöm szépen!', 'Nagyon szépen köszönjük','Budapest, Magyarország']
|
56 |
+
selected_example_hu = st.selectbox('Choose an example as demo', ['None', "Generate a random sentence"] + hungarian_examples)
|
57 |
+
|
58 |
+
if selected_example_hu != 'None':
|
59 |
+
input_string_hungarian = selected_example_hu
|
60 |
+
|
61 |
+
if selected_example_hu == "Generate a random sentence" :
|
62 |
+
input_string_hungarian = random_sentence('hu')
|
63 |
+
|
64 |
+
if st.button("Transliterate Hungarian"):
|
65 |
+
if input_string_hungarian:
|
66 |
+
output_string = hungarian_sentence_to_latin(input_string_hungarian)
|
67 |
+
st.subheader("Transliterated Output:")
|
68 |
+
if selected_example_hu == "Generate a random sentence" :
|
69 |
+
st.write(input_string_hungarian)
|
70 |
+
st.write(output_string)
|
71 |
+
else:
|
72 |
+
st.write(output_string)
|
73 |
+
else:
|
74 |
+
st.warning("Please enter a string.")
|
75 |
|
76 |
with tab3:
|
77 |
|