Skip to content
Snippets Groups Projects
Verified Commit eeff530c authored by Frank Sauerburger's avatar Frank Sauerburger
Browse files

Improve code quality

parent 8f09a8f7
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ import qgram
app = Flask(__name__)
with open("examples/titles.json") as fileobj:
with open("examples/titles.json", encoding="utf-8") as fileobj:
titles = json.load(fileobj)
index = qgram.QGramIndex()
......@@ -18,6 +18,7 @@ for title, _ in titles.values():
@app.route("/")
def suggest():
"""Serve movie title suggestions"""
query = request.args.get("q")
if not query:
return {}
......@@ -26,4 +27,3 @@ def suggest():
return {
"suggestions": results[:100]
}
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