cdleong commited on
Commit
0c3b1db
·
1 Parent(s): f8d0565

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -8,12 +8,14 @@ from allosaurus.app import read_recognizer
8
 
9
  def get_langcode_for_allosaurus(input_code):
10
  langcode = "ipa" # the default allosaurus recognizer
 
11
  try:
12
  lang = langcodes.get(input_code)
13
  langcode = lang.to_alpha3()
 
14
  except langcodes.LanguageTagError as e:
15
  pass
16
- return langcode
17
 
18
 
19
 
@@ -21,8 +23,8 @@ def get_langcode_for_allosaurus(input_code):
21
 
22
  if __name__ == "__main__":
23
  input_code = st.text_input("(optional) 2 or 3-letter ISO code for input language", max_chars=3)
24
- langcode = get_langcode_for_allosaurus(input_code)
25
- st.write(f"Instructing allosaurus to recognize using language {langcode}")
26
 
27
  model = read_recognizer()
28
 
 
8
 
9
  def get_langcode_for_allosaurus(input_code):
10
  langcode = "ipa" # the default allosaurus recognizer
11
+ description = "the default universal setting, not specific to any language"
12
  try:
13
  lang = langcodes.get(input_code)
14
  langcode = lang.to_alpha3()
15
+ description = lang.display_name()
16
  except langcodes.LanguageTagError as e:
17
  pass
18
+ return langcode, description
19
 
20
 
21
 
 
23
 
24
  if __name__ == "__main__":
25
  input_code = st.text_input("(optional) 2 or 3-letter ISO code for input language", max_chars=3)
26
+ langcode, description = get_langcode_for_allosaurus(input_code)
27
+ st.write(f"Instructing Allosaurus to recognize using language {langcode}. That is, {}")
28
 
29
  model = read_recognizer()
30