cdleong commited on
Commit
731f6bd
β€’
1 Parent(s): 651c679

add support for cmn-Hant

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -65,6 +65,7 @@ def get_valid_epitran_mappings_list():
65
  map_files = map_path.glob("*.*")
66
  valid_mappings = [map_file.stem for map_file in map_files]
67
  valid_mappings.append("cmn-Hans") # special case
 
68
 
69
  problem_mappings = ['generic-Latn',
70
  'tur-Latn-bab',
@@ -80,7 +81,7 @@ def get_valid_epitran_mappings_list():
80
 
81
 
82
  def get_epitran(selected_mapping):
83
- if selected_mapping == "cmn-Hans":
84
  st.info("Chinese requires a special dictionary. Downloading now")
85
  epitran.download.cedict()
86
 
@@ -116,7 +117,8 @@ if __name__ == "__main__":
116
  epi = get_epitran(str(selected_mapping))
117
 
118
  examples = defaultdict(lambda: 'Try typing some words in the language you chose, and they will be transliterated.')
119
- examples['cmn-Hans'] = 'ε€ͺεˆζœ‰ι“οΌŒι“δΈŽη₯žεŒεœ¨οΌŒι“ε°±ζ˜―η₯žγ€‚'
 
120
  examples['swa-Latn'] = 'Mwanzoni Kabla ulimwengu haujaumbwa alikuwepo Neno Huyo Neno alikuwa pamoja na Mungu, na Neno alikuwa Mungu.'
121
 
122
  input_text = st.text_area(label="Whatever you type here will be transliterated!", value=examples[selected_mapping])
 
65
  map_files = map_path.glob("*.*")
66
  valid_mappings = [map_file.stem for map_file in map_files]
67
  valid_mappings.append("cmn-Hans") # special case
68
+ valid_mappings.append("cmn-Hant") # Taiwan #1
69
 
70
  problem_mappings = ['generic-Latn',
71
  'tur-Latn-bab',
 
81
 
82
 
83
  def get_epitran(selected_mapping):
84
+ if selected_mapping == "cmn-Hans" or selected_mapping == "cmn-Hant":
85
  st.info("Chinese requires a special dictionary. Downloading now")
86
  epitran.download.cedict()
87
 
 
117
  epi = get_epitran(str(selected_mapping))
118
 
119
  examples = defaultdict(lambda: 'Try typing some words in the language you chose, and they will be transliterated.')
120
+ examples['cmn-Hans'] = 'ε€ͺεˆζœ‰ι“οΌŒι“δΈŽη₯žεŒεœ¨οΌŒι“ε°±ζ˜―η₯ž'
121
+ examples['cmn-Hant'] = 'ε€ͺεˆζœ‰ι“οΌŒι“θˆ‡η₯žεŒεœ¨οΌŒι“ε°±ζ˜―η₯žγ€‚'
122
  examples['swa-Latn'] = 'Mwanzoni Kabla ulimwengu haujaumbwa alikuwepo Neno Huyo Neno alikuwa pamoja na Mungu, na Neno alikuwa Mungu.'
123
 
124
  input_text = st.text_area(label="Whatever you type here will be transliterated!", value=examples[selected_mapping])