Loading TOC...


   $uri as String[],
   $word as String,
   [$options as Object?]
) as Sequence


Suggests a list of spellings for a word. Returns a Sequence containing the most likely spellings for the specified word.

$uri The URIs of the dictionaries to use.
$word The word for which you get spelling suggestions.
$options The options object for this suggest operation. The default is null.

The spell.suggest options include:

Specifies the maximum number of suggestions to be returned. The default is 10.
Specifies a cut off threshold for suggestions having a distance less than the given number. The default is 100.

Usage Notes

The spell.suggest function only provides suggestions to words that are less than 64 characters in length; words 64 characters or longer return no suggestions. Also, it removes any dictionary entries that are 64 characters or more, so it will never return a suggestion with greater than 64 characters.



=> A Sequence with the values for each suggestion:
   occasionally occasional occasion occasions occasion's
   occasioned optionally educationally irrationally


spell.suggest("spell.xml", "albetros")

=> A Sequence with the values for each suggestion:
   albatross abettors alders alters Albert's Elbert's
   allegros alder's Walters abettor's

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.