|
|
spell:suggest(
|
|
$uri as xs:string*,
|
|
$word as xs:string,
|
|
[$options as node()?]
|
| ) as xs:string* |
|
 |
Summary:
Suggests a list of spellings for a word. Returns a sequence of the most
likely spellings for the specified word.
|
Parameters:
$uri
:
The URIs of the dictionarys to use.
|
$word
:
The word for which you get spelling suggestions.
|
$options
(optional):
The options node for this suggest operation. The default is ().
The node for the spell:suggest options must be in the
http://marklogic.com/xdmp/spell namespace.
The spell:suggest options include:
<maximum>
- Specifies the maximum number of suggestions to be returned.
The default is 10.
<distance-threshold>
- Specifies a cut off threshold for suggestions having a distance
less than the gven number. The default is 100.
|
|
Usage Notes:
The spell:suggest function is a built-in function and
does not require the import module statement in the XQuery
prolog.
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.
|
Example:
spell:suggest("myDictionary.xml","occasionally")
=> occasionally occasional occasion occasions occasion's
occasioned optionally educationally irrationally
|
Example:
spell:suggest("spell.xml", "albetros")
=> albatross abettors alders alters Albert's Elbert's
allegros alder's Walters abettor's
|
|
|
|
spell:suggest-detailed(
|
|
$uri as xs:string*,
|
|
$word as xs:string,
|
|
[$options as node()?]
|
| ) as spell:suggestion* |
|
 |
Summary:
Suggests a list of spellings for a word. Returns a sequence of elements
describing each suggestion, including the suggested word, the distance,
the key distance, the word distance, and the levenshtein distance.
|
Parameters:
$uri
:
The URIs of the dictionarys to use.
|
$word
:
The word for which you get spelling suggestions.
|
$options
(optional):
The options node for this suggest operation. The default is ().
The node for the spell:suggest-detailed options must be in the
http://marklogic.com/xdmp/spell namespace.
The spell:suggest-detailed options include:
<maximum>
- Specifies the maximum number of suggestions to be returned.
The default is 10.
<distance-threshold>
- Specifies a cut off threshold for suggestions having a distance
less than the gven number. The default is 100.
|
|
Usage Notes:
The spell:suggest-detailed function is a built-in
function and does not require the import module statement
in the XQuery prolog.
The spell:suggest-detailed 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.
|
Example:
spell:suggest-detailed("myDictionary.xml","occasionally")
=> ()
|
Example:
spell:suggest("spell.xml", "albetros")
=>
<spell:suggestion original="albetros" dictionary="spell.xml">
<spell:word
distance="26"
key-distance="0"
word-distance="95"
levenshtein-distance="2">
albatross
</spell:word>
</spell:suggestion>
|
|
|