File size: 2,641 Bytes
ae7c243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7439772
 
ae7c243
7439772
ae7c243
7439772
ae7c243
 
 
 
 
7439772
ae7c243
 
7439772
ae7c243
 
 
 
 
 
 
7439772
ae7c243
 
 
 
 
4c6968c
ae7c243
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# import streamlit as st
# from polish import polish_sentence_to_latin

# st.title("Language Transliteration Interface")

# input_string = st.text_input("Enter a Polish word/sentence to transliterate :")

# example1 = "Dziękuję bardzo!"  # Example 1
# example2 = "Wszystkiego najlepszego!"  # Example 2
# example3 = "Jarosław, Przemyśl"

# selected_example = st.selectbox('Choose an example as demo',
#     ('None','Dziękuję bardzo!', 'Wszystkiego najlepszego!', 'Jarosław, Przemyśl'))

# if selected_example == 'Dziękuję bardzo!':
#     input_string = 'Dziękuję bardzo!'
# elif selected_example == 'Wszystkiego najlepszego!':
#     input_string = 'Wszystkiego najlepszego!'
# elif selected_example == 'Jarosław, Przemyśl':
#     input_string = 'Jarosław, Przemyśl'
# else:
#     input_string = input_string

    
# if st.button("Transliterate"):
#     if input_string:
#         output_string = polish_sentence_to_latin(input_string)
#         st.subheader("Transliterated Output:")
#         st.write(output_string)
#     else:
#         st.warning("Please enter a string.")

import streamlit as st
from polish import polish_sentence_to_latin
from hungarian import hungarian_sentence_to_latin

tab1, tab2= st.tabs(["Polish", "Hungarian"])

with tab1:
    st.header("Polish Transliteration")
    input_string = st.text_input("Enter a Polish word/sentence to transliterate:")
    polish_examples = ['Dziękuję bardzo!', 'Wszystkiego najlepszego!', 'Jarosław, Przemyśl']
    selected_example = st.selectbox('Choose an example as demo', ['None'] + polish_examples)

    if selected_example != 'None':
        input_string = selected_example

    if st.button("Transliterate"):
        if input_string:
            output_string = polish_sentence_to_latin(input_string)
            st.subheader("Transliterated Output:")
            st.write(output_string)
        else:
            st.warning("Please enter a string.")

with tab2:
    st.header("Hungarian Transliteration")
    input_string = st.text_input("Enter a Hungarian word/sentence to transliterate:")
    hungarian_examples = ['Köszönöm szépen!', 'Budapest, Magyarország']
    selected_example = st.selectbox('Choose an example as demo', ['None'] + hungarian_examples)

    if selected_example != 'None':
        input_string = selected_example

    if st.button("Transliterate"):
        if input_string:
            output_string = hungarian_sentence_to_latin(input_string)
            st.subheader("Transliterated Output:")
            st.write(output_string)
        else:
            st.warning("Please enter a string.")