"concordiaSearch","tmId" => $tmId,"pattern" => $inputSentence); // 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($request), ), ); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); $data = json_decode($response); } function sub($string, $start, $end = null) { if (is_null($end)) { return mb_substr($string, $start, null, 'UTF-8'); } else { return mb_substr($string, $start, $end-$start, 'UTF-8'); } } ?>
search clear help
Concordia score: result->bestOverlayScore*100) ?>%
result->bestOverlay);$i++) { $fragment = $data->result->bestOverlay[$i]; //previous unmarked fragment echo sub($inputSentence,$lastInsertedEnd, $fragment->matchedPatternStart); //the marked fragment ?>matchedPatternStart, $fragment->matchedPatternEnd) ?>matchedPatternEnd; //fragments += renderFragment(fragment, i); } //remaining unmarked fragment echo sub($inputSentence, $lastInsertedEnd); ?>



result->bestOverlay as $fragment) { ?>