"concordiaSearch","tmId" => intval($_GET["tmId"]),"pattern" => $_GET["pattern"]); // use key 'http' even if you send the request to https://... $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => json_encode($data), ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); $data = json_decode($response); ?>
Concordia score: result->bestOverlayScore*100) ?>%
result->bestOverlay);$i++) { $fragment = $data->result->bestOverlay[i]; //previous unmarked fragment $markedSentence += substr($inputSentence,$lastInsertedEnd, $fragment->matchedPatternStart - $lastInsertedEnd); //the marked fragment $markedSentence += ''+substr($inputSentence,$fragment->matchedPatternStart, $fragment->matchedPatternEnd - $fragment->matchedPatternStart)+''; $lastInsertedEnd = $fragment->matchedPatternEnd; //fragments += renderFragment(fragment, i); } //remaining unmarked fragment $markedSentence += substr($inputSentence, $lastInsertedEnd); ?>