Command name: grammar_check |
Here is a list of all possible parameters and values that can be used with the grammar_check command.
# | Parameter | Possible values | Default value | Description | |
---|---|---|---|---|---|
1 | format |
| json | The response format for the output data. | |
2 | callback |
| A callback function name that will be used to manipulate with the JSON data received from the server. Such approach enables sharing of data bypassing same-origin policy. It can be used only along with “format=json”. | ||
3 | text |
| A piece of text which will be sent for check. The text has to be in the UTF-8 encoding. Any found tags in the text will be interpreted as a plan text as well. | ||
4 | slang |
| en_US | A short code of a language which will be used for grammar checking.
|
https://svc.webspellchecker.net/api?cmd=grammar_check&format=xml&text=web API provides a gramar checking command that will help you builds a custom solution.&slang=en_US&customerid=[your-service-id] |
Parameters:
Request response:
<grammar_check> <grammar_problem> <sentence>web API provides a gramar checking command that will help you builds a custom solution</sentence> <matches> <match> <message>This sentence does not start with an uppercase letter</message> <offset>0</offset> <length>3</length> <rule> <id>UPPERCASE_SENTENCE_START</id> </rule> <suggestions> <suggestion>Web</suggestion> </suggestions> </match> </matches> </grammar_problem> </grammar_check> |
https://svc.webspellchecker.net/api?cmd=grammar_check&format=json&text=web API provides a gramar checking command that will help you builds a custom solution.&slang=en_US&customerid=[your-service-id] |
Parameters:
Request response:
[ { "sentence": "web API provides a gramar checking command that will help you builds a custom solution", "matches": [ { "message": "This sentence does not start with an uppercase letter", "offset": 0, "length": 3, "rule": { "id": "UPPERCASE_SENTENCE_START" }, "suggestions": [ "Web" ] } ] } ] |
Here we use the same request and parameters as described in example above but form it as a POST request.
https://svc.webspellchecker.net/api? |
cmd=grammar_check&format=json&text=web API provides a gramar checking command that will help you builds a custom solution.&slang=en_US&customerid=[your-service-id] |
Request response:
[ { "sentence": "web API provides a gramar checking command that will help you builds a custom solution", "matches": [ { "message": "This sentence does not start with an uppercase letter", "offset": 0, "length": 3, "rule": { "id": "UPPERCASE_SENTENCE_START" }, "suggestions": [ "Web" ] } ] } ] |