Removed some printouts

This commit is contained in:
Jocavdh 2018-06-11 14:49:05 +02:00
parent 7cf5677221
commit e4d9d0f17b
2 changed files with 3 additions and 8 deletions

View File

@ -182,7 +182,6 @@ $(document).ready(function()
q: request.term, // in flask, "q" will be the argument to look for using request.args
}, function(data) {
response(data); // matching_results from jsonify
console.log("this" + data);
});
},
search: function() {

View File

@ -445,20 +445,16 @@ def autocomplete_search():
#query = request.form['search']
query = request.args.get('q')
query_tokenized = query.lower().split()
print(query_tokenized)
#print(query_tokenized)
word_1 = query_tokenized[-2]
word_2 = query_tokenized[-1]
print(word_1)
print(word_2)
#print(word_1)
#print(word_2)
autocomplete_output = autocomplete.predict(word_1 , word_2)
autocomplete_suggestions.clear()
for suggestion, score in autocomplete_output:
autocomplete_suggestions.append(suggestion)
session['autocomplete_suggestions'] = str(autocomplete_suggestions)
print(session['autocomplete_suggestions'])
return Response(json.dumps(autocomplete_suggestions), mimetype='application/json')