You are here

public function SearchApiSpellcheck::getSuggestion in Search API Spellcheck 7

Pass a string and if it can be improved by any of the suggestions or sub-services added then return a suggesiton. If no change can be suggested return FALSE.

Parameters

string: Word or sentance.

Return value

SearchApiSpellcheckSuggestion if any suggestions could be applied. If not then returns FALSE.

2 calls to SearchApiSpellcheck::getSuggestion()
SearchApiSpellcheck::getSuggestionLinkForArg in includes/SearchApiSpellcheck.inc
Accepts a Drupal arg number which is used to get the value submitted and returns a link to the current page with whatever value is in the URL argument replaced with a suggestion.
SearchApiSpellcheck::getSuggestionLinkForGet in includes/SearchApiSpellcheck.inc
Accepts a a query string key which is used to get the value submitted and

File

includes/SearchApiSpellcheck.inc, line 106
Spellcheck Service Interface and Class.

Class

SearchApiSpellcheck

Code

public function getSuggestion($original_string) {
  if ($suggestion = $this
    ->suggestString($original_string)) {
    return new SearchApiSpellcheckSuggestion($original_string, $suggestion);
  }
  return FALSE;
}