{"_id":"micro-spelling-correcter","_rev":"166624","name":"micro-spelling-correcter","description":"Simple breadth-first early terminating Levenshtein distance auto correcter for small sets of possible resulting strings.","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"stroncium","email":"yanis.benson@gmail.com"}],"time":{"modified":"2021-06-03T11:46:40.000Z","created":"2020-02-24T18:11:53.486Z","1.1.1":"2020-02-24T18:55:38.238Z","1.1.0":"2020-02-24T18:37:37.138Z","1.0.0":"2020-02-24T18:11:53.486Z"},"users":{},"author":{"name":"Yanis Benson","email":"yanis.benson+project.nodejs.micro-spelling-correcter@gmail.com"},"versions":{"1.1.1":{"name":"micro-spelling-correcter","version":"1.1.1","description":"Simple breadth-first early terminating Levenshtein distance auto correcter for small sets of possible resulting strings.","main":"index.js","scripts":{"test":"nyc ava && xo","coverage":"codecov"},"keywords":["suggestion","correction","spelling"],"author":{"name":"Yanis Benson","email":"yanis.benson+project.nodejs.micro-spelling-correcter@gmail.com"},"bugs":{"url":"https://github.com/stroncium/nodejs-procfs/issues","email":"yanis.benson+project.nodejs.micro-spelling-correcter@gmail.com"},"license":"CC0-1.0","devDependencies":{"ava":"^3.4.0","codecov":"^3.6.5","nyc":"^15.0.0","xo":"^0.26.1"},"xo":{"rules":{"comma-dangle":["error","always-multiline"],"prefer-const":["off"],"padding-line-between-statements":["off"],"radix":["off"],"no-return-assign":["off"],"no-control-regex":["off"],"capitalized-comments":["off"],"spaced-comment":["off"],"unicorn/filename-case":["off"],"unicorn/no-hex-escape":["off"],"prefer-destructuring":["off"],"operator-assignment":["off"]}},"gitHead":"04066e452b18d765d99dbb43843d5ed8aac39dbb","_id":"micro-spelling-correcter@1.1.1","_nodeVersion":"12.13.1","_npmVersion":"6.13.7","dist":{"shasum":"805a06a26ccfcad8f3e5c6a1ac5ff29d4530166e","size":4838,"noattachment":false,"key":"/micro-spelling-correcter/-/micro-spelling-correcter-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/micro-spelling-correcter/download/micro-spelling-correcter-1.1.1.tgz"},"maintainers":[{"name":"stroncium","email":"yanis.benson@gmail.com"}],"_npmUser":{"name":"stroncium","email":"yanis.benson@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micro-spelling-correcter_1.1.1_1582570538103_0.02583786836951596"},"_hasShrinkwrap":false,"publish_time":1582570538238,"_cnpm_publish_time":1582570538238},"1.1.0":{"name":"micro-spelling-correcter","version":"1.1.0","description":"Simple breadth-first early terminating Levenshtein distance auto correcter for small sets of possible resulting strings.","main":"index.js","scripts":{"test":"nyc ava && xo","coverage":"codecov"},"keywords":["suggestion","correction","spelling"],"author":{"name":"Yanis Benson","email":"yanis.benson+project.nodejs.micro-spelling-correcter@gmail.com"},"bugs":{"url":"https://github.com/stroncium/nodejs-procfs/issues","email":"yanis.benson+project.nodejs.micro-spelling-correcter@gmail.com"},"license":"CC0-1.0","devDependencies":{"ava":"^3.4.0","codecov":"^3.6.5","nyc":"^15.0.0","xo":"^0.26.1"},"xo":{"rules":{"comma-dangle":["error","always-multiline"],"prefer-const":["off"],"padding-line-between-statements":["off"],"radix":["off"],"no-return-assign":["off"],"no-control-regex":["off"],"capitalized-comments":["off"],"spaced-comment":["off"],"unicorn/filename-case":["off"],"unicorn/no-hex-escape":["off"],"prefer-destructuring":["off"],"operator-assignment":["off"]}},"gitHead":"372de3fb365b7a706cdf7fd751b08043a98d18cc","_id":"micro-spelling-correcter@1.1.0","_nodeVersion":"12.13.1","_npmVersion":"6.13.7","dist":{"shasum":"ab4784670a59d291878b2d47b12377c1a7fec029","size":4834,"noattachment":false,"key":"/micro-spelling-correcter/-/micro-spelling-correcter-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/micro-spelling-correcter/download/micro-spelling-correcter-1.1.0.tgz"},"maintainers":[{"name":"stroncium","email":"yanis.benson@gmail.com"}],"_npmUser":{"name":"stroncium","email":"yanis.benson@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micro-spelling-correcter_1.1.0_1582569457008_0.688799533923655"},"_hasShrinkwrap":false,"publish_time":1582569457138,"_cnpm_publish_time":1582569457138},"1.0.0":{"name":"micro-spelling-correcter","version":"1.0.0","description":"Simple breadth-first early terminating Levenshtein distance auto correcter for small sets of possible resulting strings.","main":"index.js","scripts":{"test":"nyc ava && xo","coverage":"codecov"},"keywords":["suggestion","correction","spelling"],"author":{"name":"Yanis Benson","email":"yanis.benson+project.nodejs.micro-spelling-correcter@gmail.com"},"bugs":{"url":"https://github.com/stroncium/nodejs-procfs/issues","email":"yanis.benson+project.nodejs.micro-spelling-correcter@gmail.com"},"license":"CC0-1.0","devDependencies":{"ava":"^3.4.0","codecov":"^3.6.5","nyc":"^15.0.0","xo":"^0.26.1"},"xo":{"rules":{"comma-dangle":["error","always-multiline"],"prefer-const":["off"],"padding-line-between-statements":["off"],"radix":["off"],"no-return-assign":["off"],"no-control-regex":["off"],"capitalized-comments":["off"],"spaced-comment":["off"],"unicorn/filename-case":["off"],"unicorn/no-hex-escape":["off"],"prefer-destructuring":["off"],"operator-assignment":["off"]}},"gitHead":"b8749ae6d9fa591dcae35c68bb65a1ffb66cd4d4","_id":"micro-spelling-correcter@1.0.0","_nodeVersion":"12.13.1","_npmVersion":"6.13.7","dist":{"shasum":"479f13bc86daa29d1b999f5c2fe1d88a29daf495","size":4714,"noattachment":false,"key":"/micro-spelling-correcter/-/micro-spelling-correcter-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/micro-spelling-correcter/download/micro-spelling-correcter-1.0.0.tgz"},"maintainers":[{"name":"stroncium","email":"yanis.benson@gmail.com"}],"_npmUser":{"name":"stroncium","email":"yanis.benson@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micro-spelling-correcter_1.0.0_1582567913301_0.7977214108755977"},"_hasShrinkwrap":false,"publish_time":1582567913486,"_cnpm_publish_time":1582567913486}},"readme":"# micro-spelling-correcter [![Build Status](https://travis-ci.com/stroncium/nodejs-procfs.svg?branch=master)](https://travis-ci.com/stroncium/nodejs-procfs) [![codecov](https://codecov.io/gh/stroncium/micro-spelling-correcter/branch/master/graph/badge.svg)](https://codecov.io/gh/stroncium/micro-spelling-correcter)\n\nSimple breadth-first early terminating Levenshtein distance auto correcter for small sets of possible resulting strings.\n\nFinds first suiting correction for word if there is one with distance less or equal than target maximum distance and returns it, otherwise returns `undefined`.\n\nAdditionally, applies a simple heuristic of limiting max distance to half input length rounded down but not lessser than one, which helps to escape corrections which feel weird in real life(like 'a' => 'is', 'foo' => 'log' with distance 2).\n\nDetails:\n - Cost of every edit is counted as 1, though for every analyzed distance search tries skips then replacements then transpositions then additions.\n - Checks if word is in target word set at start and just returns the word if it is(so you don't need to check it yourself).\n\n## Example\n\n`npm install micro-spelling-correcter`\n\n```js\nconst MicroSpellingCorrecter = require('micro-spelling-correcter');\n\nlet correcter = new MicroSpellingCorrecter(\n\t[ // list of target words\n\t\t'word',\n\t\t'sample',\n\t\t'hydralisk',\n\t],\n\t1 // target maximum distance, defaults to 2\n);\n\ncorrecter.correct('word'); // 'word', fast path\ncorrecter.correct('wurd'); // 'word'\ncorrecter.correct('simple'); // 'sample'\ncorrecter.correct('mutalisk'); // undefined\ncorrecter.correct('ampule'); // undefined\ncorrecter.correct('ampule', 2); // 'sample', with custom edit distance of 2\n```","_attachments":{},"bugs":{"url":"https://github.com/stroncium/nodejs-procfs/issues","email":"yanis.benson+project.nodejs.micro-spelling-correcter@gmail.com"},"license":"CC0-1.0"}