@helios-interactive/babbler
Minimal email domain spellchecker. Calculates Levenshtein distance to included list of domains for errors. Returns the most relevant match.
Last updated 2 years ago by mneil .
Original npm · Tarball · package.json
$ cnpm install @helios-interactive/babbler 
SYNC missed versions from official npm registry.

Babbler

Minimal email domain spellchecker. Calculates Levenshtein distance to included list of domains for errors. Returns the most relevant match.

Install

npm i -S babbler

Plain Jane

<script src="./node_modules/babbler/dist/babbler.min.js"></script>

CommonJS

const Babbler = require('babbler');

AMD

define(['babbler'], function(Babbler){

});

ES6

import Babbler from './node_modules/babbler/src/index.js'

Usage

Check

Check if the email is spelled correctly. Returns the closest match.

Incorrect spelling

Babbler.Check('michael@gnail.com');
// {suggestion: 'michael@gmail.com', domain: 'gmail.com' distance: 1}

Correct spelling

Babbler.Check('michael@gmail.com');
// true

Invalid email address

Babbler.Check('michaelgmail.com');
// false

Domains

Append, overwrite, or get the domains list babbler checks against.

Append

Babbler.Domains(['something.co']);

Overwrite

Babbler.Domains(['something.co'], true);

Get

Babbler.Domains();

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

1 Versions

  • 1.0.0                                ...           2 years ago
Downloads
Today 0
This Week 1
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (14)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |