POST
/
v1
/
validate
/
spell_check
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": 123,
        "total_tokens": 219
  }
}

Params

text
string
required

The text to check.

language_code
string
default:"en"
required

The language code of the text. Default is “en”.

x-api-key
string
required

Your JigsawStack API key

Response

success
boolean

Indicates whether the call was successful.

message
string

The message returned by the API.

misspellings_found
number

The number of misspellings found in the text.

auto_correct_text
string

The auto corrected text.

If no misspellings were found, the original text is returned.

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": 123,
        "total_tokens": 219
  }
}