Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt Include
IN:_include_check_command_server_cloud_55x
IN:_include_check_command_server_cloud_55x
nopaneltrue

Example 1.1 [GET]: Check request for American English text with all available check types (output in JSON)

Code Block
titleRequest URL (GET): 
http(s)://svc.webspellchecker.net/spellcheck31/script/ssrv.fcgi?cmd=check&text=this sampl text demonstrates the work of the Web API service.&lang=en_US&format=json&customerid=[your-service-id]

...

  • Command: check

  • Text: this sampl text demonstrates the work of the Web API service.

  • Language: en_US

  • Format: json

Request Responseresponse:

Code Block
languagejs
themeEmacs
{
    "result": [
        {
            "matches": [
                {
                    "type": "spelling",
                    "offset": 5,
                    "length": 5,
                    "suggestions": [
                        "sample",
                        "sampled",
                        "sampler",
                        "samples",
                        "ample",
                        "amply",
                        "scamp",
                        "stamp"
                    ]
                },
                {
                    "type": "grammar",
                    "offset": 0,
                    "length": 4,
                    "rule": "UPPERCASE_SENTENCE_START",
                    "message": "This sentence does not start with an uppercase letter",
                    "suggestions": [
                        "This"
                    ]
                }
            ]
        }
    ]
}

Example 1.2 [GET]: Check request for American English text with all available check types (output in XML)

Code Block
titleRequest URL (GET): 
http(s)://svc.webspellchecker.net/spellcheck31/script/ssrv.fcgi?cmd=check&text=this sampl text demonstrates the work of the Web API service.&lang=en_US&format=xml&customerid=[your-service-id]

...

  • Command: check
  • Text: this sampl text demonstrates the work of the Web API service.
  • Language: en_US
  • Format: xml

Request Responseresponse:

Code Block
languagexml
themeEmacs
<result>
	<result>
		<matches>
			<matches>
				<type>spelling</type>
				<offset>5</offset>
				<length>5</length>
				<suggestions>
					<suggestions>sample</suggestions>
					<suggestions>sampled</suggestions>
					<suggestions>sampler</suggestions>
					<suggestions>samples</suggestions>
					<suggestions>ample</suggestions>
					<suggestions>amply</suggestions>
					<suggestions>scamp</suggestions>
					<suggestions>stamp</suggestions>
				</suggestions>
			</matches>
			<type>grammar</type>
			<offset>0</offset>
			<length>4</length>
			<rule>UPPERCASE_SENTENCE_START</rule>
			<message>This sentence does not start with an uppercase letter</message>
			<suggestions>
				<suggestions>This</suggestions>
			</suggestions>
		</matches>
	</result>
</result>

Example 1.3 [GET]: Check request for American English text as two tokens with all available check types (output in JSON)

Code Block
titleRequest URL (GET): 
https://svc.webspellchecker.net/spellcheck31/script/ssrv.fcgi?cmd=check&tokens=["this sampl text.", " It demonstrate the work of the Web API service."]&lang=en_US&customerid=[your-service-id]

...

  • Command: check

  • Tokens: ["this sampl text.", " It demonstrate the work of the Web API service."]

  • Language: en_US

  • Format: json

Request Responseresponse:

Code Block
languagejs
themeEmacs
{
    "result": [
        {
            "matches": [
                {
                    "type": "spelling",
                    "offset": 5,
                    "length": 5,
                    "suggestions": [
                        "sample",
                        "sampled",
                        "sampler",
                        "samples",
                        "ample",
                        "amply",
                        "scamp",
                        "stamp"
                    ]
                },
                {
                    "type": "grammar",
                    "offset": 0,
                    "length": 4,
                    "rule": "UPPERCASE_SENTENCE_START",
                    "message": "This sentence does not start with an uppercase letter",
                    "suggestions": [
                        "This"
                    ]
                }
            ]
        },
        {
            "matches": [
                {
                    "type": "grammar",
                    "offset": 4,
                    "length": 11,
                    "rule": "IT_VBZ",
                    "message": "Did you mean demonstrates?",
                    "suggestions": [
                        "demonstrates"
                    ]
                }
            ]
        }
    ]
}

Example 1.4 [GET]: Check request for American English text as two tokens with all available check types and shorntened response (output in JSON)

Code Block
titleRequest URL (GET): 
https://svc.webspellchecker.net/spellcheck31/script/ssrv.fcgi?cmd=check&tokens=["this sampl text.", " It demonstrate the work of the Web API service."]&lang=en_US&short_answer=true&customerid=[your-service-id]

...

  • Command: check

  • Tokens: ["this sampl text.", " It demonstrate the work of the Web API service."]

  • Language: en_US

  • Format: json

  • Short Answer: true

Request Responseresponse:

Code Block
languagejs
themeEmacs
{
    "r": [
        {
            "m": [
                {
                    "t": "spelling",
                    "o": 5,
                    "l": 5,
                    "s": [
                        "sample",
                        "sampled",
                        "sampler",
                        "samples",
                        "ample",
                        "amply",
                        "scamp",
                        "stamp"
                    ]
                },
                {
                    "t": "grammar",
                    "o": 0,
                    "l": 4,
                    "r": "UPPERCASE_SENTENCE_START",
                    "m": "This sentence does not start with an uppercase letter",
                    "s": [
                        "This"
                    ]
                }
            ]
        },
        {
            "m": [
                {
                    "t": "grammar",
                    "o": 4,
                    "l": 11,
                    "r": "IT_VBZ",
                    "m": "Did you mean demonstrates?",
                    "s": [
                        "demonstrates"
                    ]
                }
            ]
        }
    ]
}

Example 1.4 [POST]: Check request for American English text with all available check types (output in JSON)

Here we use the same request and parameters as described in example 1.1 but form it as a POST request.

...

Code Block
titleBody (Raw): 
cmd=check&text=this sampl text demonstrates the work of the Web API service.&lang=en_US&format=json&customerid=[your-service-id]

Request Responseresponse:

Code Block
languagejs
themeEmacs
{
    "result": [
        {
            "matches": [
                {
                    "type": "spelling",
                    "offset": 5,
                    "length": 5,
                    "suggestions": [
                        "sample",
                        "sampled",
                        "sampler",
                        "samples",
                        "ample",
                        "amply",
                        "scamp",
                        "stamp"
                    ]
                },
                {
                    "type": "grammar",
                    "offset": 0,
                    "length": 4,
                    "rule": "UPPERCASE_SENTENCE_START",
                    "message": "This sentence does not start with an uppercase letter",
                    "suggestions": [
                        "This"
                    ]
                }
            ]
        }
    ]
}

...