cdleong commited on
Commit
a0fdec6
1 Parent(s): 3689459

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -4,10 +4,12 @@ import langcodes
4
  # https://huggingface.co/blog/streamlit-spaces
5
  langtext = st.text_input("language lookup using https://github.com/rspeer/langcodes, see also https://r12a.github.io/app-subtags/", "english")
6
 
 
 
7
  if langcodes.tag_is_valid(langtext):
8
- st.write(f"{langtext} is already a valid BCP-47 language tag")
9
  else:
10
- st.write(f"{langtext} is not already a valid BCP-47 language tag")
11
 
12
 
13
  try:
 
4
  # https://huggingface.co/blog/streamlit-spaces
5
  langtext = st.text_input("language lookup using https://github.com/rspeer/langcodes, see also https://r12a.github.io/app-subtags/", "english")
6
 
7
+ st.write("Checking whether the tag is valid. That is, the language, script, territory, and variants (if present) are all tags that have meanings assigned by IANA.")
8
+
9
  if langcodes.tag_is_valid(langtext):
10
+ st.write(f"{langtext} parses meaningfully as a language tag according to IANA.")
11
  else:
12
+ st.write(f"{langtext} doesn't parse meaningfully as a language tag according to IANA, some of its subcomponents may be invalid or it might be a natural language description.")
13
 
14
 
15
  try: