Toggle menu

spellcheck(text)

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

NameTypeDescription
textString, requiredThe text to perform the spellcheck on

Returns

PropertyTypeDescription
dataArray of objectsEach object in the array corresponds to one word
data.suggestionsArrayAn array of suggested words
data.indexIntegerThe index position of the word
data.wordStringThe 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"
}

Last modified on August 01, 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon