You are here

protected function SuggestionsSpellCheck::formCombination in Search API Spellcheck 8.3

Combine a suggestion based on the odometer.

1 call to SuggestionsSpellCheck::formCombination()
SuggestionsSpellCheck::combineArrays in src/Plugin/views/area/SuggestionsSpellCheck.php
Combine multiple arrays to one array with all possible suggestions.

File

src/Plugin/views/area/SuggestionsSpellCheck.php, line 119

Class

SuggestionsSpellCheck
Provides an area for messages.

Namespace

Drupal\search_api_spellcheck\Plugin\views\area

Code

protected function formCombination(array $odometer, array $suggestions) {
  $output = '';
  $count = count($odometer);
  for ($i = 0; $i < $count; $i++) {
    if ($i === 0) {
      $output .= $suggestions[$i][$odometer[$i]];
    }
    else {
      $output .= ' ' . $suggestions[$i][$odometer[$i]];
    }
  }
  return $output;
}