Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,25 @@ import epitran
|
|
3 |
|
4 |
if __name__ == "__main__":
|
5 |
iso_lang_code = st.text_input(
|
6 |
-
label="Three-letter
|
7 |
value="swa"
|
8 |
)
|
9 |
st.write(f"iso code is {iso_lang_code}")
|
10 |
|
11 |
iso_script_code = st.text_input(
|
12 |
-
label="
|
|
|
|
|
13 |
st.write(f'iso code is {iso_script_code }')
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
|
|
3 |
|
4 |
if __name__ == "__main__":
|
5 |
iso_lang_code = st.text_input(
|
6 |
+
label="Three-letter ISO-639-3 (https://iso639-3.sil.org/) language code",
|
7 |
value="swa"
|
8 |
)
|
9 |
st.write(f"iso code is {iso_lang_code}")
|
10 |
|
11 |
iso_script_code = st.text_input(
|
12 |
+
label="ISO 15924 (https://unicode.org/iso15924/iso15924-codes.html) script code, e.g. 'Latn' for Latin script, 'Hans' for Chinese script, etc.",
|
13 |
+
value="Latn"
|
14 |
+
)
|
15 |
st.write(f'iso code is {iso_script_code }')
|
16 |
|
17 |
+
input_text = st.text_area(label, value="Gari langu linaloangama limejaa na mikunga")
|
18 |
+
|
19 |
+
combined_code = "-".join(iso_lang_code, iso_script_code)
|
20 |
+
st.write(f"Combined code: {combined_code}")
|
21 |
+
st.info("attempting to instantiate epitran transliterator for your language/script")
|
22 |
+
epi = epitran.Epitran(combined_code)
|
23 |
+
|
24 |
+
transliteration = epi.transliterate(input_text)
|
25 |
+
st.info("transliterating...")
|
26 |
+
|
27 |
|