typo-js
A Hunspell-style spellchecker.
Last updated 4 years ago by cfinke .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install typo-js 
SYNC missed versions from official npm registry.

Typo.js is a JavaScript spellchecker that uses Hunspell-style dictionaries.

Usage

To use Typo, simply load it like so:

var Typo = require("typo-js");
var dictionary = new Typo(lang_code);

Typo includes by default a dictionary for the en_US lang_code.

To check if a word is spelled correctly, do this:

var is_spelled_correctly = dictionary.check("mispelled");

To get suggested corrections for a misspelled word, do this:

var array_of_suggestions = dictionary.suggest("mispeling");

// array_of_suggestions == ["misspelling", "dispelling", "misdealing", "misfiling", "misruling"]

Typo.js has full support for the following Hunspell affix flags:

  • PFX
  • SFX
  • REP
  • FLAG
  • COMPOUNDMIN
  • COMPOUNDRULE
  • ONLYINCOMPOUND
  • KEEPCASE
  • NOSUGGEST
  • NEEDAFFIX

Licensing

Typo.js is free software, licensed under the Modified BSD License.

Current Tags

  • 1.2.1                                ...           latest (4 years ago)

7 Versions

  • 1.2.1                                ...           4 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.3                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 3
Last Day 0
Last Week 3
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |