Fix initial download of wordnet module
Committed 9c2989
--- a/webint_search/__init__.py
+++ b/webint_search/__init__.py
import re
import sqlite3
import string
+import subprocess
import black
import easyuri
url["term"] = query
raise web.SeeOther(url)
- nltk.download("wordnet")
word = query
snow = nltk.stem.SnowballStemmer("english")
stem = snow.stem(query)
try:
en = wn.Wordnet("oewn:2022")
except (sqlite3.OperationalError, wn.Error):
- pass # TODO download Open English WordNet `python -m wn download oewn:2022`
+ web.enqueue(subprocess.run, ["python", "-m", "wn", "download", "oewn:2022"])
else:
try:
definition = en.synsets(query)[0].definition()