Commit c2eb9af5 authored by Bas de Nooijer's avatar Bas de Nooijer

Fix for issue #184

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