diff --git a/cat/concordia_search.php_pattern b/cat/concordia_search.php_pattern
index 1bcc6ff..23e55ac 100644
--- a/cat/concordia_search.php_pattern
+++ b/cat/concordia_search.php_pattern
@@ -32,35 +32,29 @@ $data = json_decode($response);
Concordia score: = round($data->result->bestOverlayScore*100) ?>%
Phrase search mode: ![search for phrases enter phrase search mode](../images/switchOff.png)
Select continuous phrase: ';
-
- var inputSentence = $('#search-input').val();
- var markedSentence = '';
- var fragments = '';
- lastInsertedEnd = 0;
- for(var i = 0; i < data['result']['bestOverlay'].length; i++) {
- var fragment = data['result']['bestOverlay'][i];
+ $inputSentence = $_GET["pattern"];
+ $markedSentence = "";
+ $fragments = array();
+ $lastInsertedEnd = 0;
+ for($i=0; $iresult->bestOverlay);$i++) {
+ $fragment = data->result->bestOverlay[i];
//previous unmarked fragment
- markedSentence += inputSentence.slice(lastInsertedEnd, fragment['matchedPatternStart']);
+ $markedSentence += substr($inputSentence,$lastInsertedEnd, $fragment->matchedPatternStart - $lastInsertedEnd);
//the marked fragment
- markedSentence += ''+inputSentence.slice(fragment['matchedPatternStart'], fragment['matchedPatternEnd'])+'';
+ $markedSentence += ''+substr($inputSentence,$fragment->matchedPatternStart, $fragment->matchedPatternEnd - $fragment->matchedPatternStart)+'';
- lastInsertedEnd = fragment['matchedPatternEnd'];
+ $lastInsertedEnd = $fragment->matchedPatternEnd;
+
+ //fragments += renderFragment(fragment, i);
- fragments += renderFragment(fragment, i);
}
-
//remaining unmarked fragment
- markedSentence += inputSentence.slice(lastInsertedEnd);
-
- res += ''+markedSentence+'
';
-
- res += '
'+fragments;
- */
+ $markedSentence += substr($inputSentence, $lastInsertedEnd);
?>
+ =$markedSentence ?>
+