Params
The language code of the target language to translate to. All supported
language codes can be found
here.
Response
Indicates whether the call was successful.
Usage information for the API call.
Number of input tokens processed.
Number of output tokens generated.
Number of tokens processed during inference time.
Total number of tokens used (input + output).
Whether any misspellings were found in the text.
Array of misspelling objects found in the text.Show Misspelling Object Properties
The misspelled word found in the text.
The starting index position of the misspelled word in the text.
The ending index position of the misspelled word in the text.
Array of suggested correct spellings for the misspelled word.
Whether the word was automatically corrected.
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": 1095,
"total_tokens": 1191
}
}