WormBase / textpresso

Repository for TextPressoCentral
1 stars 0 forks source link

Category highlighting does not apply to selected sentence matches #112

Closed chris-grove closed 6 years ago

chris-grove commented 6 years ago

This is pretty minor, but it seems that when performing a search and then viewing a paper for matching sentences, the highlighting of the sentence matches in the Curation tab (which is nice) precludes highlighting individual words within the sentence that match a searched term or category. Here's a video demo:

https://www.dropbox.com/s/lhyvlony3w5yi9s/TPC_category_highlighting_does_not_apply_to_selected_sentence_match_11-29-2017.mov?dl=0

valearna commented 6 years ago

The function to highlight the sentences with a match was called every time a new category or keyword was selected for highlighting. I removed the call and separated the two highlighting processes. The problem should be fixed now.

chris-grove commented 6 years ago

@valearna Nice! Works great! One strange thing happens still, where it seems that parentheses '(' or ')' or basic words like 'in', 'to' or 'of' are retaining the sentence highlight color once moving on to a new sentence, but this only happens for the first sentence. Here's a video demo:

https://www.dropbox.com/s/q15pr2awinhflss/TPC_sentence_match_highlighting_leaves_residual_highlight_on_simple_words_and_parentheses_11-29-2017.mov?dl=0

I can create a separate ticket for that if necessary.

valearna commented 6 years ago

Thanks @chris-grove for the feedback! Those basic words that were retaining the highlight color were highlighted as categories somewhere else in the text, but not in the currently selected sentence. I added new control logic to identify those cases. I tested the new code using the search in the video and it seems to work correctly now.

chris-grove commented 6 years ago

@valearna OK, almost perfect, but I'm still seeing the word "in" keeping a highlight after I navigate away from the first matched sentence:

https://www.dropbox.com/s/t6xwci2fhfaj43m/TPC_sentence_match_highlighting_leaves_residual_highlight_on_simple_word_11-30-2017.mov?dl=0

It's really not a big issue, but if that is indicative of a larger or more systematic problem then I would want to fix it. Thanks!

valearna commented 6 years ago

In that case the word "in" appears in the same sentence twice, in the first case linked to a category and in the second one as a non-category. To solve the problem, I completely changed the logic for highlighting the sentences and the new strategy seems to cover all cases, although I still need to do more testing. Let me know if you find other glitches. Thanks a lot for the videos, they are really helpful!

chris-grove commented 6 years ago

OK, looks good! Closing.