diff --git a/clic/web/api.py b/clic/web/api.py index 6590a56..5f817aa 100644 --- a/clic/web/api.py +++ b/clic/web/api.py @@ -52,15 +52,17 @@ def concordances(): def fetchKeywords(args): keyworder = Keywords() args = processArgs(args, 'keywords') - keywords = keyworder.list_keywords(args[0], args[1], args[2], args[3], args[4]) - return {'keywords' : keywords} + keywordlist = keyworder.list_keywords(args[0], args[1], args[2], args[3], args[4]) + return keywordlist + # return {'keywords' : keywords} @cache.cache('clusters') def fetchClusters(args): cluster = Clusters() args = processArgs(args, 'clusters') clusterlist = cluster.list_clusters(args[0], args[1]) - return {'clusters' : clusterlist} + return clusterlist + # return {'clusters' : clusterlist} @cache.cache('concordances') def fetchConcordance(args): diff --git a/clic/web/index.py b/clic/web/index.py index 2ae95e9..becec91 100644 --- a/clic/web/index.py +++ b/clic/web/index.py @@ -1,7 +1,7 @@ from __future__ import absolute_import ## help python find modules within clic package (see John H email 09.04.2014) from flask import Flask, render_template, url_for, redirect, request -from clic.web.api import api, fetchClusters +from clic.web.api import api, fetchClusters, fetchKeywords from clic.chapter_repository import ChapterRepository app = Flask(__name__, static_url_path='') @@ -59,11 +59,15 @@ def keywords(): testIdxMod = request.args.get('testIdxMod') selectWords = "whole" + args = request.args + keywords_result = fetchKeywords(args) + return render_template("keywords-results.html", IdxGroup=IdxGroup, testCollection=testCollection, testIdxMod=testIdxMod, - selectWords=selectWords) + selectWords=selectWords, + keywords=keywords_result) else: return render_template("keywords-form.html") @@ -113,5 +117,5 @@ def chapterView(number, book, word_index = None, search_term = None): return render_template("chapter-view.html", content=chapter, book_title=book_title) # TODO delete? -# if __name__ == '__main__': -# app.run() \ No newline at end of file +#if __name__ == '__main__': +# app.run() \ No newline at end of file diff --git a/clic/web/templates/keywords-results.html b/clic/web/templates/keywords-results.html index beaaf8a..320f64f 100644 --- a/clic/web/templates/keywords-results.html +++ b/clic/web/templates/keywords-results.html @@ -10,14 +10,43 @@ {% endblock %} {% block title %} - Keywords Search {{ super() }} + Keywords {{ super() }} {% endblock %} {% block body %}
No | +n-gram | +Test Freq | +% | +Ref Freq | +% | +K | +P | +
---|---|---|---|---|---|---|---|
{{ loop.index }} | +{{ keyword[1] }} | +{{ keyword[2] }} | +{{ keyword[3] }} | +{{ keyword[4] }} | +{{ keyword[5] }} | +{{ keyword[6] }} | +{{ keyword[7] }} | +