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 'Corrections:<br/>';
foreach($collation->getCorrections() as $input => $correction) {
echo $input . ' => ' . $correction .'<br/>';
}
echo '<hr/>';
}
echo 'Corrections:<br/>';
foreach($collation->getCorrections() as $input => $correction) {
echo $input . ' => ' . $correction .'<br/>';
}
htmlFooter();
......@@ -183,14 +183,16 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
$originalFrequency = (isset($value['origFreq'])) ? $value['origFreq'] : null;
$words = array();
foreach($value['suggestion'] as $suggestion) {
if (is_string($suggestion)) {
$suggestion = array(
'word' => $suggestion,
'freq' => null,
);
if (isset($value['suggestion']) && is_array($value['suggestion'])) {
foreach($value['suggestion'] as $suggestion) {
if (is_string($suggestion)) {
$suggestion = array(
'word' => $suggestion,
'freq' => null,
);
}
$words[] = $suggestion;
}
$words[] = $suggestion;
}
return new Suggestion(
......
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