From 7ec41a03bec141ff12872c7d0aa1ddd3e35d4100 Mon Sep 17 00:00:00 2001 From: Stephan Porada Date: Tue, 3 Dec 2019 15:11:31 +0100 Subject: [PATCH] Add Inspect view --- app/corpora/CQiWrapper/CQiWrapper.py | 3 +- app/corpora/events.py | 2 +- app/templates/corpora/analyse_corpus.html.j2 | 77 +++++++++++++++++--- 3 files changed, 70 insertions(+), 12 deletions(-) diff --git a/app/corpora/CQiWrapper/CQiWrapper.py b/app/corpora/CQiWrapper/CQiWrapper.py index dc4ce1e2..eea9e558 100644 --- a/app/corpora/CQiWrapper/CQiWrapper.py +++ b/app/corpora/CQiWrapper/CQiWrapper.py @@ -296,5 +296,6 @@ class CQiWrapper(CQiClient): logger.warning('Got all sentences informations in {} seconds'. format(t_total)) match_context = {'context_s_cpos': context_sentences, 'cpos_lookup': all_cpos_infos, - 'text_lookup': text_lookup} + 'text_lookup': text_lookup, + 'match_cpos_list': match_cpos_list} return match_context diff --git a/app/corpora/events.py b/app/corpora/events.py index 53323506..e7164f23 100644 --- a/app/corpora/events.py +++ b/app/corpora/events.py @@ -47,7 +47,7 @@ def corpus_analysis(message): query = str(message['query']) result_len = int(message['hits_per_page']) context_len = int(message['context']) - result_offset = int(0) + result_offset = 0 client.select_corpus(corpus_name) client.query_subcorpus(query) results = client.show_query_results(result_len=result_len, diff --git a/app/templates/corpora/analyse_corpus.html.j2 b/app/templates/corpora/analyse_corpus.html.j2 index ccba4afc..25bcb23b 100644 --- a/app/templates/corpora/analyse_corpus.html.j2 +++ b/app/templates/corpora/analyse_corpus.html.j2 @@ -2,6 +2,12 @@ {% block page_content %}