fixed error message when word in dictionary is not found
Browse files
app.py
CHANGED
|
@@ -278,15 +278,17 @@ if selected == "App":
|
|
| 278 |
|
| 279 |
# If a word has been selected by user
|
| 280 |
if query_tag:
|
| 281 |
-
st.write(f"### {query_tag[0]}")
|
| 282 |
|
| 283 |
# Display word information
|
| 284 |
if query_tag[0] in lemma_dict:
|
|
|
|
| 285 |
data = lemma_dict[query_tag[0]]
|
| 286 |
elif query_tag[0].capitalize() in lemma_dict: # Some words are capitalized in the dictionary
|
|
|
|
| 287 |
data = lemma_dict[query_tag[0].capitalize()]
|
| 288 |
else:
|
| 289 |
st.error("Word not found in dictionary")
|
|
|
|
| 290 |
|
| 291 |
# Put text in readable format
|
| 292 |
text = format_text(data)
|
|
|
|
| 278 |
|
| 279 |
# If a word has been selected by user
|
| 280 |
if query_tag:
|
|
|
|
| 281 |
|
| 282 |
# Display word information
|
| 283 |
if query_tag[0] in lemma_dict:
|
| 284 |
+
st.write(f"### {query_tag[0]}")
|
| 285 |
data = lemma_dict[query_tag[0]]
|
| 286 |
elif query_tag[0].capitalize() in lemma_dict: # Some words are capitalized in the dictionary
|
| 287 |
+
st.write(f"### {query_tag[0].capitalize()}")
|
| 288 |
data = lemma_dict[query_tag[0].capitalize()]
|
| 289 |
else:
|
| 290 |
st.error("Word not found in dictionary")
|
| 291 |
+
exit(-1)
|
| 292 |
|
| 293 |
# Put text in readable format
|
| 294 |
text = format_text(data)
|