Skip to content

Latest commit

 

History

History
95 lines (82 loc) · 1.71 KB

README.md

File metadata and controls

95 lines (82 loc) · 1.71 KB

DEMO

See the live demo on github pages:

https://wordsuite.github.io/wordsuite/demo/demo.html

HOW TO USE

Installation

  1. Add the script tag to your site
<script src="https://wordsuite.github.io/wordsuite/client.bundle.js"></script>
  1. Create instance Create a new Spell instance
var spell = window.Spell('https://wordsuite.github.io/wordsuite/')

Usage

  1. Is word in dictionary?
spell.spell(input.value).then(console.log)

// {
//  "job": "spell",
//  "value": "testing",
//  "result": true
// }
  1. Suggest corrections for unknown word
spell.suggest(input.value).then(console.log)

// {
//   "job": "suggest",
//   "value": "testingx",
//   "result": [
//     "testing",
//     "testings",
//     "besting",
//     "jesting",
//     "nesting"
//   ]
// }
  1. Get definition of word
spell.define(input.value).then(console.log)

// {
//   "job": "define",
//   "value": "testing",
//   "result": {
//     "word": "testing",
//     "wordset_id": "a94dcf4488",
//     "meanings": [
//       {
//         "id": "d0feff1953",
//         "def": "the act of giving students or candidates a test (as by questions) to determine what they know or have learned",
//         "speech_part": "noun",
//         "synonyms": [
//           "examination"
//         ]
//       },
//       ...
//     ]
//   }
// }
  1. Look up synonyms (alternative words)
spell.alternative(input.value).then(console.log)

// {
//   "job": "alternative",
//   "value": "testing",
//   "result": [
//     "testing",
//     "R and D",
//     "analytic",
//     "control",
//     "control experiment",
//     "controlled experiment",
//     "cut and try",
//     "cut-and-try",
//     "empirical",
//     ...
//   ]
// }