From f6e63d3d53a3f4c03c646ccadf718920a0a1095e Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 27 Mar 2026 13:15:58 +0100 Subject: Make sure paths are available --- server.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'server.py') 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() -- cgit 1.4.1