From 558f7547bb98bba066a69233ac17bf0e69c3c291 Mon Sep 17 00:00:00 2001 From: Enzo Simonnet <enzosim@laposte.net> Date: Tue, 7 May 2024 15:05:59 +0200 Subject: [PATCH] simplification --- src/app.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/app.py b/src/app.py index 72fae32..39a1976 100755 --- a/src/app.py +++ b/src/app.py @@ -3,10 +3,6 @@ from flask_cors import CORS from urllib.parse import unquote import requests -# import sys -# import codecs -# sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer, 'strict') - import config from wiktextract_wrapper import Wiktextract @@ -64,7 +60,7 @@ def search(lang, word): if wiktextractor.wxr.thesaurus_db_conn: wiktextractor.wxr.thesaurus_db_conn.close() -@app.route("/search/<wiktlang>/<wordlang>/<path:word>/<format>", methods=["GET"]) +@app.route("/search/<wiktlang>/<wordlang>/<word>/<format>", methods=["GET"]) def search_and_format(wiktlang, wordlang, word, format): word = requests.utils.unquote(word) word = word.encode('latin-1').decode('utf-8') # Decode the word from Latin-1 to UTF-8 -- GitLab