- $aSuggestion = array();
- $bSuggestion = false;
- if (CONST_Suggestions_Enabled)
- {
- foreach($aPhrases as $iPhrase => $aPhrase)
- {
- if (!isset($aValidTokens[' '.$aPhrase['wordsets'][0][0]]))
- {
- $sQuotedPhrase = getDBQuoted(' '.$aPhrase['wordsets'][0][0]);
- $aSuggestionWords = getWordSuggestions($oDB, $aPhrase['wordsets'][0][0]);
- $aRow = $aSuggestionWords[0];
- if ($aRow && $aRow['word'])
- {
- $aSuggestion[] = $aRow['word'];
- $bSuggestion = true;
- }
- else
- {
- $aSuggestion[] = $aPhrase['string'];
- }
- }
- else
- {
- $aSuggestion[] = $aPhrase['string'];
- }
- }
- }
- if ($bSuggestion) $sSuggestion = join(', ',$aSuggestion);
-