Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -62,20 +62,29 @@ def pull_obsolete_codes(iso_code):
|
|
62 |
#st.write(f"langcodes found the following tag: {type(found)}") # a Language object
|
63 |
if lang is not None:
|
64 |
display = lang.display_name()
|
65 |
-
|
66 |
st.write(f"Best-match BCP-47 tag for '{langtext}', according to the langcodes library: {lang}")
|
67 |
st.write(f"Breakdown of tag components: {lang.describe()}")
|
68 |
st.write(f"Display name for {lang}: {lang.display_name()}")
|
69 |
st.write(f"Autonym for {lang}: {lang.autonym()}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
b_variant = lang.to_alpha3(variant='B')
|
71 |
t_variant = lang.to_alpha3(variant='T')
|
72 |
st.write(f"ISO 639-3 'alpha3' code, 'terminology' variant (deprecated): {t_variant}")
|
73 |
st.write(f"ISO 639-3 'alpha3' code, 'bibliographic' variant (deprecated): {b_variant}")
|
74 |
st.write(f"If it exists, the ISO 639 Code Tables entry for the T variant would be at https://iso639-3.sil.org/code/{t_variant}")
|
75 |
-
st.write(f"If it exists, the ISO 639 Code Tables entry for the B variant would be at https://iso639-3.sil.org/code/{b_variant}")
|
76 |
-
|
77 |
-
|
78 |
-
# ethnologue prefers T for german (deu), and T for French
|
79 |
obsolete_codes = pull_obsolete_codes(t_variant)
|
80 |
if obsolete_codes:
|
81 |
st.write(f"Obsolete codes from previous ISO-639 iterations:")
|
@@ -83,10 +92,6 @@ if lang is not None:
|
|
83 |
|
84 |
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
st.write(broader_tags)
|
89 |
-
st.write(f"Try also: https://r12a.github.io/app-subtags/?lookup={lang}")
|
90 |
-
st.write(f"https://glottolog.org/glottolog?search={t_variant} may be of interest, with links to Ethnologue, etc. If that doesn't work, try https://glottolog.org/glottolog?search={b_variant}")
|
91 |
-
st.write(f"## Correct, standardized, BCP-47 tag for {langtext}, according to the langcodes library: {langcodes.standardize_tag(lang)}")
|
92 |
|
62 |
#st.write(f"langcodes found the following tag: {type(found)}") # a Language object
|
63 |
if lang is not None:
|
64 |
display = lang.display_name()
|
65 |
+
st.write("## Results")
|
66 |
st.write(f"Best-match BCP-47 tag for '{langtext}', according to the langcodes library: {lang}")
|
67 |
st.write(f"Breakdown of tag components: {lang.describe()}")
|
68 |
st.write(f"Display name for {lang}: {lang.display_name()}")
|
69 |
st.write(f"Autonym for {lang}: {lang.autonym()}")
|
70 |
+
st.write(f"## Correct, standardized, BCP-47 tag for {langtext}, according to the langcodes library: {langcodes.standardize_tag(lang)}")
|
71 |
+
|
72 |
+
|
73 |
+
st.write("## Further Information:")
|
74 |
+
broader_tags = lang.broader_tags()
|
75 |
+
st.write(f"Broader tags for this language, if any:")
|
76 |
+
st.write(broader_tags)
|
77 |
+
st.write(f"Try also: https://r12a.github.io/app-subtags/?lookup={lang}")
|
78 |
+
st.write(f"https://glottolog.org/glottolog?search={t_variant} may be of interest, with links to Ethnologue, etc. If that doesn't work, try https://glottolog.org/glottolog?search={b_variant}")
|
79 |
+
|
80 |
+
# ethnologue prefers T for german (deu), and T for French
|
81 |
+
st.write("## Older Codes")
|
82 |
b_variant = lang.to_alpha3(variant='B')
|
83 |
t_variant = lang.to_alpha3(variant='T')
|
84 |
st.write(f"ISO 639-3 'alpha3' code, 'terminology' variant (deprecated): {t_variant}")
|
85 |
st.write(f"ISO 639-3 'alpha3' code, 'bibliographic' variant (deprecated): {b_variant}")
|
86 |
st.write(f"If it exists, the ISO 639 Code Tables entry for the T variant would be at https://iso639-3.sil.org/code/{t_variant}")
|
87 |
+
st.write(f"If it exists, the ISO 639 Code Tables entry for the B variant would be at https://iso639-3.sil.org/code/{b_variant}")
|
|
|
|
|
|
|
88 |
obsolete_codes = pull_obsolete_codes(t_variant)
|
89 |
if obsolete_codes:
|
90 |
st.write(f"Obsolete codes from previous ISO-639 iterations:")
|
92 |
|
93 |
|
94 |
|
95 |
+
|
96 |
+
|
|
|
|
|
|
|
|
|
97 |
|