You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constcorrections=awaitproofreader.proofread("I seen him yesterday at the store, and he bought two loafs of bread.");
51
51
```
52
52
53
-
`proofread()` corrects the input text and returns a list of corrections made. Additional proofreading features can be configured using includeCorrectionTypes and `includeCorrectionExplanations`. When `includeCorrectionTypes` is set to `true`, `proofread()` will provide an error type label for each correction made to each error. When `includeCorrectionExplanations` is set to `true`, `proofread()` will provide an annotation for each error with a plain language explanation.
53
+
`proofread()` corrects the input text and returns a list of corrections made. Additional proofreading features can be configured using includeCorrectionTypes and `includeCorrectionExplanations`. When `includeCorrectionTypes` is set to `true`, `proofread()` will provide the error type labels associated for each correction made to each error. When `includeCorrectionExplanations` is set to `true`, `proofread()` will provide an annotation for each error with a plain language explanation.
54
54
55
55
Detailed design for the corrections output is [discussed later](#proofreading-correction-output).
`type` only exists when the proofreader object is configured with `includeCorrectionTypes = true`, while `explanation` only exists when the proofreader object is configured with `includeCorrectionExplanations = true`.
208
208
209
+
Each correction could be associated with mutliple correction type labels. For example:
210
+
211
+
```js
212
+
constoriginal_text="`thatd` a good amt of time!!! !"// `thatd` is the text to be corrected
213
+
constproofread_text="`That's` a good amount of time!"// `That's` is the corrected text
214
+
```
215
+
where the correction from "thatd" to "That's" contains three types of correction - "Captilization", "Spelling" and "Punctuation". When there's only one label, the sequence will be of size 1.
216
+
209
217
Not all correction types here will be applicable to all languages, and in the future we might propose more specific correction types. The generic catch-all type, if no more-specific type matches, is `"grammar"`.
210
218
211
219
To get an error in the input, use `input.substring(startIndex, endIndex)`. Corrections in the `corrections` list will be organized in ascending order based on the `startIndex` of the correction.
0 commit comments