1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
+
+
+
-
+
|
#! /usr/bin/env node
// -*- js -*-
// Gramma-Cli
// Grammalect client pour node
/* jshint esversion:6, -W097 */
/* jslint esversion:6 */
/* global require, console */
/*
Doc :
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
https://stackoverflow.com/questions/41058569/what-is-the-difference-between-const-and-const-in-javascript
*/
const argCmd = require("./minimist.js")(process.argv.slice(2));
const argCmd = require("../lib/minimist.js")(process.argv.slice(2));
const { performance } = require("perf_hooks");
var repJson = false;
var repPerf = false;
var sBufferConsole = "";
var sCmdToExec = "";
|
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
|
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
|
-
+
+
+
-
|
});
return [hits && hits.length ? hits : cmdAll, line];
}
if (process.argv.length <= 2) {
console.log(actionToExec({help:true}));
} else {
var GrammarChecker = require("./api.js");
//var GrammarChecker = require("./api.js");
//console.log(module.paths);
var GrammarChecker = require("grammalecte");
var oGrammarChecker = new GrammarChecker.GrammarChecker(
["Grammalecte", "Graphspell", "TextFormatter", "Lexicographer", "Tokenizer"],
__dirname + "/grammalecte/",
"fr"
);
if (argCmd.server) {
var http = require("http");
var url = require("url");
var querystring = require("querystring");
|