// Simple RestAPI to correct/suggest inputbox spelling // Needed to create a spelling suggestion REST API in the // simplest & quickest way I could think of. // Free to use for everyone :)
// GET spelling.io/api/query/en/:query // Returns [ { "word": String }, ... ] // GET spelling.io/api/query/en/:query?limit=10&states=true // Returns 10 word recommendations and some useful numbers [ { "word": String, "similarity" : Float, // Number of occurrence in Open ANC (American National Corpus) "occurrence" : Integer }, ... ]
// cURL http://api.spelling.io/api/query/en/accomodation // Returns [ {"word":"accommodate"}, {"word":"accumulation"}, {"word":"action"}, {"word":"activation"} ] // cURL http://api.spelling.io/api/query/en/accomodation?limit=1&states=true // Returns [ {"word":"accommodate", "occurrence":162, "similarity":0.470588} ]
// Include the script & style : // Available at // https://github.com/yungookim/spelling.io/tree/master/presentation/dist/scripts/lib <script type="text/javascript" src="/spelling.js"></script> <link rel="stylesheet" href="/spelling.css"> // Initialize the input box : $("input[type='text']").spelling([options]) // Optional Args { limit : 5, states : true }