cdleong commited on
Commit
817d838
1 Parent(s): 0e45975

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -20,7 +20,11 @@ def get_lang_description_from_mapping_name(string_to_check):
20
  if lang:
21
  items = []
22
  for key, value in lang.describe().items():
23
- items.append(f"{key}: {value}")
 
 
 
 
24
 
25
 
26
  description = ", ".join(items)
@@ -67,9 +71,11 @@ if __name__ == "__main__":
67
  st.write("# Phonemize your text with [Epitran](https://github.com/dmort27/epitran)!")
68
 
69
  st.write("Epitran is a library and tool for transliterating orthographic text as IPA (International Phonetic Alphabet), by Mortensen, David R. and Dalmia, Siddharth and Littell, Patrick.")
70
- st.write("It supports converting many writing sytems to IPA symbols, including the following languages/scripts:")
71
  valid_epitran_mappings = get_valid_epitran_mappings_list()
72
- st.write(valid_epitran_mappings)
 
 
73
 
74
  selected_mapping = st.selectbox("Select input language/script:", valid_epitran_mappings)
75
  description = get_lang_description_from_mapping_name(selected_mapping)
 
20
  if lang:
21
  items = []
22
  for key, value in lang.describe().items():
23
+ if key == "language":
24
+ iso_code = lang.to_alpha3()
25
+ value = f"[{value}](https://iso639-3.sil.org/code/{iso_code})"
26
+ else:
27
+ items.append(f"{key}: {value}")
28
 
29
 
30
  description = ", ".join(items)
 
71
  st.write("# Phonemize your text with [Epitran](https://github.com/dmort27/epitran)!")
72
 
73
  st.write("Epitran is a library and tool for transliterating orthographic text as IPA (International Phonetic Alphabet), by Mortensen, David R. and Dalmia, Siddharth and Littell, Patrick.")
74
+
75
  valid_epitran_mappings = get_valid_epitran_mappings_list()
76
+ st.write(f"It supports converting many writing sytems to IPA symbols, including approximately {len(valid_epitran_mappings)} languages/scripts, listed below:")
77
+
78
+ #st.write(valid_epitran_mappings)
79
 
80
  selected_mapping = st.selectbox("Select input language/script:", valid_epitran_mappings)
81
  description = get_lang_description_from_mapping_name(selected_mapping)