aboutsummaryrefslogtreecommitdiff
path: root/web.py
diff options
context:
space:
mode:
authorache <ache@ache.one>2020-02-22 20:23:14 +0100
committerache <ache@ache.one>2020-02-22 20:23:14 +0100
commit1cde126e6f730605890cb299953e028d074ccf8a (patch)
tree2bc8b82fe12b75d7fae8a4652c1501fb70e70f19 /web.py
parentTest no autocapitalize (diff)
Format fix
Problem with gsm. They force the first letter to be a majuscule. Ex: Typing "manger" will become "Manger" and so will not be in the dictionary. Must be searched at manger and at Manger.
Diffstat (limited to 'web.py')
-rw-r--r--web.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/web.py b/web.py
index 282c200..4ed0f98 100644
--- a/web.py
+++ b/web.py
@@ -25,7 +25,16 @@ def index_client():
@app.route('/def', methods=['GET'])
def get_def():
- if res := dicofr.get_def_sql(request.args.get('w')):
+ w = request.args.get('w')
+
+ # Recherche du mot tapΓ©
+ if res := dicofr.get_def_sql(w):
+ return msgpack.packb(res)
+ # Recherche du mot en minuscule
+ elif res := dicofr.get_def_sql(w.lower()):
+ return msgpack.packb(res)
+ # Recherche du mot en nom propre
+ elif res := dicofr.get_def_sql(w.title()):
return msgpack.packb(res)
else:
return Response("", status=404)