From 68f31fd213c070cfac8be4ce37b5a05f05b160ee Mon Sep 17 00:00:00 2001 From: Lars Buitinck Date: Mon, 29 Jun 2015 17:29:41 +0200 Subject: [PATCH 1/2] typos --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 9da4b22..72ad0fc 100644 --- a/README.rst +++ b/README.rst @@ -133,13 +133,13 @@ The package contains several text analysis tasks to generate the terms used in t .. code-block:: bash - $ ./mange.py construct_tfidf_model gensim_data/immix_summaries.mm gensim_data/immix_summaries.tfidf_model + $ ./manage.py construct_tfidf_model gensim_data/immix_summaries.mm gensim_data/immix_summaries.tfidf_model 7. Add the topN 'most descriptive' terms to each indexed document: .. code-block:: bash - $ ./mange.py analyze_text index_descriptive_terms "immix_analyzed/summaries/*.tar.gz" gensim_data/immix_summaries_pruned.dict gensim_data/immix_summaries.tfidf_model gensim_data/immix_summaries.tfidf_model 'quamerdes_immix_20140920' 'text_descriptive_terms' 10 + $ ./manage.py analyze_text index_descriptive_terms "immix_analyzed/summaries/*.tar.gz" gensim_data/immix_summaries_pruned.dict gensim_data/immix_summaries.tfidf_model gensim_data/immix_summaries.tfidf_model 'quamerdes_immix_20140920' 'text_descriptive_terms' 10 License ------- From 0094a86f0e46b51ec85923952f4c1191dc1407eb Mon Sep 17 00:00:00 2001 From: Lars Buitinck Date: Tue, 15 Sep 2015 17:10:52 +0200 Subject: [PATCH 2/2] send query string to Delpher to enable highlighting --- avresearcher/static/js/views/search/results_list.js | 1 + .../static/templates/search/results_list_kb.html | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/avresearcher/static/js/views/search/results_list.js b/avresearcher/static/js/views/search/results_list.js index 7432fe3..08d6400 100644 --- a/avresearcher/static/js/views/search/results_list.js +++ b/avresearcher/static/js/views/search/results_list.js @@ -40,6 +40,7 @@ function($, _, Backbone, app, resultsListImmixTemplate, resultsListKbTemplate){ this.$el.find('li').remove(); this.$el.html(_.template(this.templates[this.model.get('collection')], { + query: this.model.get('ftQuery'), hits: this.model.get('hits') })); diff --git a/avresearcher/static/templates/search/results_list_kb.html b/avresearcher/static/templates/search/results_list_kb.html index 310c09a..b5b799f 100644 --- a/avresearcher/static/templates/search/results_list_kb.html +++ b/avresearcher/static/templates/search/results_list_kb.html @@ -10,8 +10,19 @@ } else { title = '(untitled article)'; } + + // Bypass the KB resolver and go straight to Delpher. Not only does + // the KB resolver add noticeable latency, it also doesn't allow us + // to send the query string along. + var re = /http:\/\/resolver\.kb\.nl\/resolve\?urn=([^&]*)/; + var url = hit.fields.source; + var match = re.exec(url); + if (match) { + url = ('http://www.delpher.nl/nl/kranten/view?coll=ddd&identifier=' + + match[1] + '&query=' + encodeURIComponent(query)); + } %> -

<%= title %>

+

<%= title %>

<% if ('meta.publication_name' in hit.fields){ %>

<%= hit.fields['meta.publication_name'] %>

<% } %> <% var format = d3.time.format('%a %b %-e, %Y');