We just rolled out 3 new ReportingCloud endpoints to integrate proofing functionality into your applications. The ReportingCloud template editor already provides 50+ different dictionaries for spell checking. This functionality is now available as a web service endpoint and can be used independently from merging documents.
Proofing Check Method
https://api.reporting.cloud/v1/proofing/check
The proofing/check method checks text for spelling errors. As query parameters, it accepts text that specifies the text to spell check and language which defines the language (see AvailableDictionaries method) that is used to spell check the specified text.
Query Parameter | Value Type | Value |
---|---|---|
text | String | Specifies the text to spell check. |
language | String | The language that is used to spell check the specified text. |
The following CURL call checks text for the language "US English":
curl -u username:password \ | |
-X GET "https://api.reporting.cloud/v1/proofing/check?text=Thiss%20is%20a%20testt&language=en_US.dic |
ReportingCloud returns an array of IncorrectWord objects:
[{"length":5,"start":0,"text":"Thiss","isDuplicate":false,"language":"en_US.dic"}, | |
{"length":5,"start":11,"text":"testt","isDuplicate":false,"language":"en_US.dic"}] |
This object contains the text, the start index position, length and language information. The isDuplicate property indicates whether a word is a duplicate in the checked text.
IncorrectWord Object
Key | Value Type | Value Description |
---|---|---|
length | Integer | Gets the length of the spelled word. |
start | Integer | Gets the starting position of a spelled word. |
text | String | Gets the text of the spelled word. |
isDuplicate | Boolean | Gets a value indicating whether the spelled word is declared as incorrect, because the previous word has the same text. |
language | String | Gets a value indicating the language the incorrect word was spelled. |
Proofing AvailableDictionaries Method
https://api.reporting.cloud/v1/proofing/availabledictionaries
This method returns all available dictionary names. These names can be used in the Check method to define the spell checking language.
Proofing Suggestions Method
https://api.reporting.cloud/v1/proofing/suggestions
This endpoint returns suggestions for a misspelled word. The query parameters must contain the word for which the suggestions should be created for, the language (see AvailableDictionaries method) and the maximum number of suggestions:
Query Parameter | Value Type | Value |
---|---|---|
word | String | Specifies the incorrect word that has to be determined for suggestions. |
language | String | The language that is used to spell check the specified text. |
max | String | Specifies the maximum number of suggestions that has to be determined. |
The following CURL call returns 10 suggestions for the word "Thiss":
curl -u username:password \ | |
-X GET "https://api.reporting.cloud/v1/proofing/suggestions?word=Thiss&language=en_US.dic&max=10 |
["This","Hiss","Thesis","Thins","Thurs","Thirsts","Thieu","Thirds","Theists","Thais"] |
Test this on your own and create a ReportingCloud trial account today.
Happy coding!