Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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}
|
| 9 |
else:
|
| 10 |
-
st.write(f"{langtext}
|
| 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:
|