diff --git a/src/app.py b/src/app.py index 72fae320cdccfa323a7aa4d76c1a0b342479f2a8..39a1976b958c5a9b024ec3bfb0233b709ec307ab 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