Commit ea735246 authored by Bas de Nooijer's avatar Bas de Nooijer Committed by Dorian Villet

Fix for issue #184

parent 15ddb76d
......@@ -50,11 +50,11 @@ echo '<h1>Collations</h1>';
foreach($collations as $collation) {
echo 'Query: '.$collation->getQuery().'<br/>';
echo 'Hits: '.$collation->getHits().'<br/>';
echo '<hr/>';
}
echo 'Corrections:<br/>';
foreach($collation->getCorrections() as $input => $correction) {
echo 'Corrections:<br/>';
foreach($collation->getCorrections() as $input => $correction) {
echo $input . ' => ' . $correction .'<br/>';
}
echo '<hr/>';
}
htmlFooter();
......@@ -183,6 +183,7 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
$originalFrequency = (isset($value['origFreq'])) ? $value['origFreq'] : null;
$words = array();
if (isset($value['suggestion']) && is_array($value['suggestion'])) {
foreach($value['suggestion'] as $suggestion) {
if (is_string($suggestion)) {
$suggestion = array(
......@@ -192,6 +193,7 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
}
$words[] = $suggestion;
}
}
return new Suggestion(
$numFound, $startOffset, $endOffset, $originalFrequency, $words
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment