Grammalecte  Check-in [a43e8d10eb]

Overview
Comment:[js] Minimal file to use in node
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | njs | nodejs
Files: files | file ages | folders
SHA3-256: a43e8d10eb1aa50001b2b46df2d86605a701371e5ca7bff5f487065ea6c33b8b
User & Date: IllusionPerdu on 2018-10-10 12:23:02
Other Links: branch diff | manifest | tags
Context
2018-10-11
15:13
[js] Revert syntax change check-in: 9ae8f0a042 user: IllusionPerdu tags: njs, nodejs
2018-10-10
12:23
[js] Minimal file to use in node check-in: a43e8d10eb user: IllusionPerdu tags: njs, nodejs
12:08
[js] All Grammalecte work in node check-in: 2d5c0dce59 user: IllusionPerdu tags: njs, nodejs
Changes

Added gc_core/js/exemple-node.js version [393f0a3208].

            1  +// JavaScript
            2  +
            3  +/* jshint esversion:6, -W097 */
            4  +/* jslint esversion:6 */
            5  +/* global require, console */
            6  +
            7  +"use strict";
            8  +
            9  +//console.log('\x1B[2J\x1B[0f'); //Clear the console (cmd win)
           10  +
           11  +var oGrammalecte = require('./fr/gc_engine.js');
           12  +
           13  +oGrammalecte.load();
           14  +
           15  +var sPhrase = 'Le silences s’amasses Étoile brillantesss';
           16  +console.log('\x1b[36m%s \x1b[32m%s\x1b[0m', 'Test de vérification de:', sPhrase);
           17  +console.log( oGrammalecte.parse(sPhrase) );
           18  +
           19  +var sWord = 'toutt';
           20  +console.log('\x1b[36m%s \x1b[32m%s\x1b[0m', 'Test de suggestion:', sWord);
           21  +var oSpellCheckGramma = oGrammalecte.getSpellChecker();
           22  +console.log( Array.from( oSpellCheckGramma.suggest(sWord) ) );