concordia search php
This commit is contained in:
parent
714a9f2f0c
commit
8cb806d47b
@ -32,12 +32,12 @@ $data = json_decode($response);
|
|||||||
<pre><?php print_r($data);?></pre>
|
<pre><?php print_r($data);?></pre>
|
||||||
<div id="result-score">Concordia score: <b><?= round($data->result->bestOverlayScore*100) ?>%</b></div>
|
<div id="result-score">Concordia score: <b><?= round($data->result->bestOverlayScore*100) ?>%</b></div>
|
||||||
<?php
|
<?php
|
||||||
/*
|
|
||||||
$inputSentence = $_GET["pattern"];
|
$inputSentence = $_GET["pattern"];
|
||||||
$markedSentence = "";
|
$markedSentence = "";
|
||||||
$fragments = array();
|
$fragments = array();
|
||||||
$lastInsertedEnd = 0;
|
$lastInsertedEnd = 0;
|
||||||
for($i=0; $i<length($data->result->bestOverlay);$i++) {
|
for($i=0; $i<count($data->result->bestOverlay);$i++) {
|
||||||
$fragment = data->result->bestOverlay[i];
|
$fragment = data->result->bestOverlay[i];
|
||||||
//previous unmarked fragment
|
//previous unmarked fragment
|
||||||
$markedSentence += substr($inputSentence,$lastInsertedEnd, $fragment->matchedPatternStart - $lastInsertedEnd);
|
$markedSentence += substr($inputSentence,$lastInsertedEnd, $fragment->matchedPatternStart - $lastInsertedEnd);
|
||||||
@ -52,7 +52,7 @@ $data = json_decode($response);
|
|||||||
}
|
}
|
||||||
//remaining unmarked fragment
|
//remaining unmarked fragment
|
||||||
$markedSentence += substr($inputSentence, $lastInsertedEnd);
|
$markedSentence += substr($inputSentence, $lastInsertedEnd);
|
||||||
*/
|
|
||||||
?>
|
?>
|
||||||
<div id="result-sentence" onMouseUp="phraseSearch(this)"><?=$markedSentence ?></div>
|
<div id="result-sentence" onMouseUp="phraseSearch(this)"><?=$markedSentence ?></div>
|
||||||
<br/><br/><br/>
|
<br/><br/><br/>
|
||||||
|
Loading…
Reference in New Issue
Block a user