Commit a9a97395 authored by Ujvari Gergely's avatar Ujvari Gergely

Bugfix: Text tokenizing

parent d1a9c4ff
...@@ -436,6 +436,7 @@ class Search ...@@ -436,6 +436,7 @@ class Search
$scope.search_filter = $routeParams.matched $scope.search_filter = $routeParams.matched
heatmap = annotator.plugins.Heatmap heatmap = annotator.plugins.Heatmap
threads = [] threads = []
text_tokens = $routeParams.in_body_text.split ' '
for bucket in heatmap.buckets for bucket in heatmap.buckets
for annotation in bucket for annotation in bucket
thread = annotator.threading.getContainer annotation.id thread = annotator.threading.getContainer annotation.id
......
...@@ -145,6 +145,7 @@ class Hypothesis extends Annotator ...@@ -145,6 +145,7 @@ class Hypothesis extends Annotator
if searchItem.attributes.category is 'text' if searchItem.attributes.category is 'text'
in_body_text = searchItem.attributes.value.toLowerCase() in_body_text = searchItem.attributes.value.toLowerCase()
text_tokens = searchItem.attributes.value.split ' '
if searchItem.attributes.category is 'tag' if searchItem.attributes.category is 'tag'
tag_search = searchItem.attributes.value.toLowerCase() tag_search = searchItem.attributes.value.toLowerCase()
...@@ -165,9 +166,15 @@ class Hypothesis extends Annotator ...@@ -165,9 +166,15 @@ class Hypothesis extends Annotator
matches = false matches = false
break break
when 'text' when 'text'
unless annotation.text? and annotation.text.toLowerCase().indexOf(value.toLowerCase()) > -1 unless annotation.text?
matches = false matches = false
break break
for token in text_tokens
unless annotation.text.toLowerCase().indexOf(token.toLowerCase()) > -1
matches = false
break
when 'tag' when 'tag'
unless annotation.tags? unless annotation.tags?
matches = false 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