diff options
| author | Pjotr Prins | 2026-03-27 13:15:58 +0100 |
|---|---|---|
| committer | Pjotr Prins | 2026-03-27 13:15:58 +0100 |
| commit | f6e63d3d53a3f4c03c646ccadf718920a0a1095e (patch) | |
| tree | 2f7fc652c2238e0fbe17f2117e9df18c69a441b1 /server.py | |
| parent | 643bb3f622da68b109f3a99524713c8c1e66239b (diff) | |
| download | genecup-f6e63d3d53a3f4c03c646ccadf718920a0a1095e.tar.gz | |
Make sure paths are available
Diffstat (limited to 'server.py')
| -rwxr-xr-x | server.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server.py b/server.py index ad8c29d..868572e 100755 --- a/server.py +++ b/server.py @@ -103,6 +103,14 @@ def get_sentences_from_file(file_path, gene_name, category_name=None): nltk.data.path.append("./nlp/") +# Validate punkt tokenizer is available +try: + nltk.data.find('tokenizers/punkt') +except LookupError: + print("ERROR: NLTK punkt tokenizer not found. Set NLTK_DATA or install punkt data.") + print(" NLTK data paths: " + str(nltk.data.path)) + raise SystemExit(1) + # Initialize database within application context with app.app_context(): db.create_all() |
