Description
This method checks a supplied string for spelling mistakes. It returns the unknown word, its index position in the string, and an array of suggestions.
Note that this method will make a request to the icmapi worker to execute iCM_obj_SpellCheck. This is because the spell checking can only be performed by iCM.
Parameters
Name | Type | Description |
---|---|---|
text | String, required | The text to perform the spellcheck on |
Returns
Property | Type | Description |
---|---|---|
data | Array of objects | Each object in the array corresponds to one word |
data.suggestions | Array | An array of suggested words |
data.index | Integer | The index position of the word |
data.word | String | The word that failed the spellcheck |
Example
Request
function(params, credentials) {
let request = this.callWorkerMethod('formutils', 'spellcheck', {
'text': 'words pumpkinwords words words notarealword'
});
return request;
}
Response
{
"id": 61,
"result": {
"data": [{
"suggestions": ["pumpkin words", "pumpkinseeds", "pumpkinseed", "pumpkin", "pumpkins", "bumpkin", "bumpkins", "plumping"],
"index": 6,
"word": "pumpkinwords"
}, {
"suggestions": ["northeastward", "northeastwards", "integrator", "notaries", "integrators", "northeastwardly", "untraceable", "Notre"],
"index": 31,
"word": "notarealword"
}],
"success": true
},
"jsonrpc": "2.0"
}