Giter Club home page Giter Club logo

pasquale's Introduction

pasquale Build Status

Checks for spelling errors in a given sentence (UNDER HEAVY DEV.)

$ npm install --save pasquale   # for your project
$ npm install -g pasquale-cli   # cli version

Check out the cli version.

Usage

pasquale is intended to be used as a module for checking spelling errors. You must, then, provide dicts for this.

For downloading them: $ PASQUALE_PATH/bin/downloader [lang-alias].

Example

pasquale = new Pasquale();
pasquale.setLanguage('en-ca');
pasquale.checkTextSpell('this is greatt').then(function (results) {
	console.log(results);
}, function (err) {
	console.error(err);
});

// [ { word: 'this', correct: true },
//   { word: 'is', correct: true },
//   { word: 'greatt',
//     correct: false,
//     suggestions: [ 'great', 'greats', 'great t', 'Gretta' ] } ]

Reference

Pasquale (options)

/**
 * Constructor for Pasquale.
 * @param {object} options object containing
 * some options to be used: ignored -> words to
 * be ignored
 */

.setLanguage (lang, dir)

/**
 * Sets the language to check the texts against
 * @param {string} lang The language as
 *                      described in lang-mapping
 * @param {string} dir the abs path to the dicts
 *                     dir
 */

.checkTextSpell (text)

/**
 * Checks the spelling of a given text (multi or
 * single line)
 * @param  {string} text The text to check
 * @return {Promise}      a promise containing
 * the results (array of arrays)
 */

.checkLineSpell (text, lineCount)

/**
 * Checks the spelling for a given line.
 * @param  {string} text      A line of text
 * @param  {string|number} lineCount the number
 * of the line
 * @return {Promise}   A promisse with the
 * results (array)
 */

.checkWordSpell (word, opts)

/**
 * Checks the spelling for a given word
 * @param  {string} word the word to check
 * @param  {obj} opts some more info about where
 * the word was found
 * @return {promise}      A promise containing
 * the results for the word
 */

Languages

Using the default (bower_components/Dictionaries), the supported languages are:

name key
Català
Croatian
Dansk
Deutsch de
Deutsch (AT) de-at
Deutsch (CH) de-ch
Deutsch (DE) de-de
Czech cs
Ελληνικά
English (Canadian) en-ca
English (British) en-gb
Español es
Français fr
Galego
Italiano
Lietuvių
Magyar
Nederlands
Norwegian (Bokmål)
Norwegian (Nynorsk)
Română
Polski
Português (do Brasil) pt-br
Português (Europeu) pt
Русский
Slovenian
Slovensky
Svenska
Tiếng Việt
Українська

LICENSE

MIT LICENSE

pasquale's People

Stargazers

azu avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

pasquale's Issues

Do not download all the dicitonaries

Executing bower install is taking a while. The set of dictionaries is arround 100MiB. It'd be better if we could split them and then let the user decide which dictionaries to use.

Another great feature would be to let the user specify some 'word exceptions', like a config, idk.

Error on 0.10.28

1509 error [email protected] install: `node-gyp rebuild`
1509 error Exit status 1
1510 error Failed at the [email protected] install script.
1510 error This is most likely a problem with the spellcheck package,
1510 error not with npm itself.
1510 error Tell the author that this fails on your system:
1510 error     node-gyp rebuild
1510 error You can get their info via:
1510 error     npm owner ls spellcheck
1510 error There is likely additional logging output above.
1511 error System Linux 3.11.0-12-generic
1512 error command "/home/administrador/.nvm/v0.10.28/bin/node" "/home/administrador/.nvm/v0.10.28/bin/npm" "install" "-g" "pasquale"
1513 error cwd /home/administrador/Apontador/apontador-webmanager
1514 error node -v v0.10.28
1515 error npm -v 1.4.9
1516 error code ELIFECYCLE
1517 verbose exit [ 1, true ]

Integrating Pasquale to a Build workflow

I've been thinking of how could one integrate pasquale to a build sys.

Maybe gulp-pasquale-md is not so modular. Something like : gulp.src(markdown-text) --> marked-wi --> pasquale --> ....

With something like that we could keep with : gulp.src(normal-text) --> pasquale --> ....

Port Hunspell to JS

It would be great if this could be browser-ready. Maybe something like Ghost could benefit from this

Return (Line:Column) for each non-correct

Line

iterate over the newlines :0

Column

Maybe something like:

var reg = new RegExp(/ciro/gi);
var text = 'aaaacirobbbbbciro';

reg.exec(text);
// [ 'ciro', index: 4, input: 'aaaacirobbbbbciro' ]
reg.exec(text);
// [ 'ciro', index: 13, input: 'aaaacirobbbbbciro' ]
reg.exec(text);
// null

Separate the bin version

Maybe it would be better to separate the bin part of pasquale to pasquale-bin, or something like that.

Show Progress

for some large texts the spell checking might not be so fast.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.