Grammalecte  Check-in [b79bb889b9]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minimal file to use in node
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | graphspell | njs | nodejs
Files: files | file ages | folders
SHA3-256:b79bb889b996de002f7f0e4c7777a6fe5442e394f11e41566685e583a3dcecfa
User & Date: IllusionPerdu 2018-10-10 09:36:48
Context
2018-10-10
12:08
[js] All Grammalecte work in node check-in: 2d5c0dce59 user: IllusionPerdu tags: njs, nodejs
09:36
Minimal file to use in node check-in: b79bb889b9 user: IllusionPerdu tags: graphspell, njs, nodejs
09:19
Some change to javascript to work in node check-in: a3687f4fd3 user: IllusionPerdu tags: graphspell, njs, nodejs
Changes

Added graphspell-js/test/minimal.js.

            1  +/* jshint esversion:6, -W097 */
            2  +/* jslint esversion:6 */
            3  +/* global require, console */
            4  +
            5  +"use strict";
            6  +
            7  +/*
            8  +Reset = "\x1b[0m"
            9  +Bright = "\x1b[1m"
           10  +Dim = "\x1b[2m"
           11  +Underscore = "\x1b[4m"
           12  +Blink = "\x1b[5m"
           13  +Reverse = "\x1b[7m"
           14  +Hidden = "\x1b[8m"
           15  +
           16  +FgBlack = "\x1b[30m"
           17  +FgRed = "\x1b[31m"
           18  +FgGreen = "\x1b[32m"
           19  +FgYellow = "\x1b[33m"
           20  +FgBlue = "\x1b[34m"
           21  +FgMagenta = "\x1b[35m"
           22  +FgCyan = "\x1b[36m"
           23  +FgWhite = "\x1b[37m"
           24  +
           25  +BgBlack = "\x1b[40m"
           26  +BgRed = "\x1b[41m"
           27  +BgGreen = "\x1b[42m"
           28  +BgYellow = "\x1b[43m"
           29  +BgBlue = "\x1b[44m"
           30  +BgMagenta = "\x1b[45m"
           31  +BgCyan = "\x1b[46m"
           32  +BgWhite = "\x1b[47m"
           33  +*/
           34  +
           35  +//console.log('\x1B[2J\x1B[0f'); //Clear the console (cmd win)
           36  +
           37  +var spellCheck = require("../spellchecker.js");
           38  +var checker = new spellCheck.SpellChecker('fr', '../_dictionaries');
           39  +
           40  +function perf(sWord){
           41  +    console.log('\x1b[1m\x1b[31m%s\x1b[0m', '--------------------------------');
           42  +
           43  +    console.log('\x1b[36m%s \x1b[32m%s\x1b[0m', 'Vérification de:', sWord);
           44  +    console.time('Valid:'+sWord);
           45  +    console.log(sWord, checker.isValid(sWord) );
           46  +    console.timeEnd('Valid:'+sWord);
           47  +
           48  +    console.log('\x1b[36m%s \x1b[32m%s\x1b[0m', 'Suggestion de:', sWord);
           49  +    console.time('Suggestion:'+sWord);
           50  +    console.log( JSON.stringify( Array.from(checker.suggest(sWord)) ) );
           51  +    console.timeEnd('Suggestion:'+sWord);
           52  +}
           53  +
           54  +perf('binjour');
           55  +perf('saluté');
           56  +perf('graphspell');
           57  +perf('dicollecte');