def search2(): from Top53 import find5,corpora C = corpora() terms = request.form.get('q').split() a = [ find5(t, C) for t in terms ] results = [ " ".join(zip(*a)[0]), " ".join(zip(*a)[1]), " ".join(zip(*a)[2]), " ".join(zip(*a)[3]), " ".join(zip(*a)[4]) ] return render_template('results.html', suggestions=results, query=request.form.get('q') )
def searchold(): C, D, Collocs = corpora() if " " not in request.form.get('q'): results = find5( request.form.get('q'), C ) else: words = request.form.get('q').split(" ",1) list1 = find10(words[0],C) list2 = find10(words[1],C) results = choosecolloc5(list1,list2,Collocs) return render_template('results.html', suggestions=results, query=request.form.get('q') )
def search2(): from Top53 import find5, corpora C = corpora() terms = request.form.get('q').split() a = [find5(t, C) for t in terms] results = [ " ".join(zip(*a)[0]), " ".join(zip(*a)[1]), " ".join(zip(*a)[2]), " ".join(zip(*a)[3]), " ".join(zip(*a)[4]) ] return render_template('results.html', suggestions=results, query=request.form.get('q'))
def searchold(): C, D, Collocs = corpora() if " " not in request.form.get('q'): results = find5(request.form.get('q'), C) else: words = request.form.get('q').split(" ", 1) list1 = find10(words[0], C) list2 = find10(words[1], C) results = choosecolloc5(list1, list2, Collocs) return render_template('results.html', suggestions=results, query=request.form.get('q'))