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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// JavaScript

/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, console */

"use strict";

//console.log('\x1B[2J\x1B[0f'); //Clear the console (cmd win)

var oGrammalecte = require('./fr/gc_engine.js');

oGrammalecte.load();

var sPhrase = 'Le silences s’amasses Étoile brillantesss';
console.log('\x1b[36m%s \x1b[32m%s\x1b[0m', 'Test de vérification de:', sPhrase);
console.log( oGrammalecte.parse(sPhrase) );

var sWord = 'toutt';
console.log('\x1b[36m%s \x1b[32m%s\x1b[0m', 'Test de suggestion:', sWord);
var oSpellCheckGramma = oGrammalecte.getSpellChecker();
console.log( Array.from( oSpellCheckGramma.suggest(sWord) ) );