Check and correct spelling errors in a text.
import { JigsawStack } from "jigsawstack"; const jigsaw = JigsawStack({ apiKey: "your-api-key" }); const response = await jigsaw.validate.spellcheck({ "text": "This sentense has a speling mistake." })
{ "success": true, "misspellings_found": true, "misspellings": [ { "word": "sentense", "startIndex": 5, "endIndex": 13, "expected": [ "sentence" ], "auto_corrected": true }, { "word": "speling", "startIndex": 20, "endIndex": 27, "expected": [ "spelling", "spewing", "spieling" ], "auto_corrected": true } ], "auto_correct_text": "This sentence has a spelling mistake.", "_usage": { "input_tokens": 13, "output_tokens": 83, "inference_time_tokens": 829, "total_tokens": 925 } }
Was this page helpful?