diff --git a/app.py b/app.py index 64849d369758f76c4897f63fc1ae666d1444aae0..81e7a6da8bb0e0414b1e4dbf1f2d919d3573a15f 100644 --- a/app.py +++ b/app.py @@ -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] } -