Spaces:
Runtime error
Runtime error
Use st.cache
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ def pull_obsolete_codes(iso_code):
|
|
49 |
obsolete_codes[obsolete_code_name] = code
|
50 |
return obsolete_codes
|
51 |
|
52 |
-
|
53 |
def try_retrieving_glottolog_id(langtext):
|
54 |
languoid_id = ""
|
55 |
langtext_quoted = urllib.parse.quote(langtext)
|
@@ -61,12 +61,14 @@ def try_retrieving_glottolog_id(langtext):
|
|
61 |
last_section = returned_url.split("/")[-1]
|
62 |
languoid_id = last_section
|
63 |
return languoid_id
|
64 |
-
|
|
|
65 |
def get_glottolog_json(languoid_id):
|
66 |
query_url=f"https://glottolog.org/resource/languoid/id/{languoid_id}.json"
|
67 |
glottolog_r = session.get(query_url)
|
68 |
return glottolog_r.json()
|
69 |
|
|
|
70 |
def try_searching_vachan_engine(langtext):
|
71 |
results_list = []
|
72 |
langtext_quoted = urllib.parse.quote(langtext)
|
|
|
49 |
obsolete_codes[obsolete_code_name] = code
|
50 |
return obsolete_codes
|
51 |
|
52 |
+
@st.cache
|
53 |
def try_retrieving_glottolog_id(langtext):
|
54 |
languoid_id = ""
|
55 |
langtext_quoted = urllib.parse.quote(langtext)
|
|
|
61 |
last_section = returned_url.split("/")[-1]
|
62 |
languoid_id = last_section
|
63 |
return languoid_id
|
64 |
+
|
65 |
+
@st.cache
|
66 |
def get_glottolog_json(languoid_id):
|
67 |
query_url=f"https://glottolog.org/resource/languoid/id/{languoid_id}.json"
|
68 |
glottolog_r = session.get(query_url)
|
69 |
return glottolog_r.json()
|
70 |
|
71 |
+
@st.cache
|
72 |
def try_searching_vachan_engine(langtext):
|
73 |
results_list = []
|
74 |
langtext_quoted = urllib.parse.quote(langtext)
|