Skip to content
Snippets Groups Projects
Commit 558f7547 authored by Enzo Simonnet's avatar Enzo Simonnet
Browse files

simplification

parent b8a0d209
No related branches found
No related tags found
No related merge requests found
...@@ -3,10 +3,6 @@ from flask_cors import CORS ...@@ -3,10 +3,6 @@ from flask_cors import CORS
from urllib.parse import unquote from urllib.parse import unquote
import requests import requests
# import sys
# import codecs
# sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer, 'strict')
import config import config
from wiktextract_wrapper import Wiktextract from wiktextract_wrapper import Wiktextract
...@@ -64,7 +60,7 @@ def search(lang, word): ...@@ -64,7 +60,7 @@ def search(lang, word):
if wiktextractor.wxr.thesaurus_db_conn: if wiktextractor.wxr.thesaurus_db_conn:
wiktextractor.wxr.thesaurus_db_conn.close() 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): def search_and_format(wiktlang, wordlang, word, format):
word = requests.utils.unquote(word) word = requests.utils.unquote(word)
word = word.encode('latin-1').decode('utf-8') # Decode the word from Latin-1 to UTF-8 word = word.encode('latin-1').decode('utf-8') # Decode the word from Latin-1 to UTF-8
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment