diff options
author | ache <ache@ache.one> | 2020-02-22 20:23:14 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2020-02-22 20:23:14 +0100 |
commit | 1cde126e6f730605890cb299953e028d074ccf8a (patch) | |
tree | 2bc8b82fe12b75d7fae8a4652c1501fb70e70f19 /web.py | |
parent | Test 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.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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) |