Commit a9a97395 authored by Ujvari Gergely's avatar Ujvari Gergely

Bugfix: Text tokenizing

parent d1a9c4ff
......@@ -436,6 +436,7 @@ class Search
$scope.search_filter = $routeParams.matched
heatmap = annotator.plugins.Heatmap
threads = []
text_tokens = $routeParams.in_body_text.split ' '
for bucket in heatmap.buckets
for annotation in bucket
thread = annotator.threading.getContainer annotation.id
......
......@@ -145,6 +145,7 @@ class Hypothesis extends Annotator
if searchItem.attributes.category is 'text'
in_body_text = searchItem.attributes.value.toLowerCase()
text_tokens = searchItem.attributes.value.split ' '
if searchItem.attributes.category is 'tag'
tag_search = searchItem.attributes.value.toLowerCase()
......@@ -165,9 +166,15 @@ class Hypothesis extends Annotator
matches = false
break
when 'text'
unless annotation.text? and annotation.text.toLowerCase().indexOf(value.toLowerCase()) > -1
unless annotation.text?
matches = false
break
for token in text_tokens
unless annotation.text.toLowerCase().indexOf(token.toLowerCase()) > -1
matches = false
break
when 'tag'
unless annotation.tags?
matches = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment