From 22923fb426c1d810f570bf2812a065b739e4f7c3 Mon Sep 17 00:00:00 2001 From: rjawor Date: Thu, 27 Aug 2015 07:29:29 +0200 Subject: [PATCH] cat --- cat/examples.txt | 1 + cat/js/cat.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cat/examples.txt b/cat/examples.txt index 52b524f..39860c5 100644 --- a/cat/examples.txt +++ b/cat/examples.txt @@ -1,3 +1,4 @@ Każde państwo unii europejskiej dba o dobro obywateli i służbę zdrowia. Obywatel chce utrzymać jakość życia na wysokim poziomie. Gruntowna naprawa silnika samochodu. +Umowa została sporządzona w trzech jednobrzmiących egzemplarzach diff --git a/cat/js/cat.js b/cat/js/cat.js index 9767255..6d84058 100644 --- a/cat/js/cat.js +++ b/cat/js/cat.js @@ -43,7 +43,7 @@ function renderResult(data) { markedSentence += inputSentence.slice(lastInsertedEnd, fragment['matchedPatternStart']); //the marked fragment - markedSentence += ''+inputSentence.slice(fragment['matchedPatternStart'], fragment['matchedPatternEnd'])+''; + markedSentence += ''+inputSentence.slice(fragment['matchedPatternStart'], fragment['matchedPatternEnd'])+''; lastInsertedEnd = fragment['matchedPatternEnd']; @@ -74,7 +74,9 @@ function renderFragment(fragment, number) { return result; } -function displayDetails(number) { +function displayDetails(caller, number) { + $('#result-sentence .matchedFragmentSelected').attr("class","matchedFragment"); + caller.className='matchedFragmentSelected'; $('.fragmentDetails').css('display', 'none'); $('#fragment'+number).css('display', 'block'); }