Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
dasajitk17 authored Sep 23, 2018
1 parent a87f386 commit 2b4f3f5
Show file tree
Hide file tree
Showing 22 changed files with 1,204 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
for the pretty version, see [compromise.cool/docs](http://compromise.cool/docs)

this is the json version of the docs, which are run [as part of the unit tests](../tests/unit/docs/docs.test.js)
this ensures that the docs stay somewhat up-to-date
765 changes: 765 additions & 0 deletions docs/api.json

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions node_modules/efrt-unpack/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions node_modules/efrt-unpack/efrt-unpack.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions node_modules/efrt-unpack/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions node_modules/efrt-unpack/quick.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions scripts/benchmark.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
var benchmark = require('./lib/benchmark');
var fs = require('fs');
var chalk = require('chalk');

var redGreen = function(last, now, unit) {
var diff = (now - last).toFixed(2);
var percent = diff / last * 100;
percent = parseInt(percent, 10);
if (percent < 0) {
console.log(' ' + chalk.green(' ' + percent + '% ' + diff + ' ' + unit));
} else if (percent === 0) {
console.log(' ' + chalk.yellow(' ' + percent + '% ' + diff + ' ' + unit));
} else {
console.log(' ' + chalk.red('+' + percent + '% ' + diff + ' ' + unit));
}
console.log('');
};

var compare = function(obj) {
console.log('');
var last = JSON.parse(fs.readFileSync('./scripts/lib/log.json'));
console.log(' size:');
redGreen(last.size, obj.size, 'kb');
console.log(' init:');
redGreen(last.init, obj.init, 'ms');
console.log(' parse:');
redGreen(last.big, obj.big, 'ms');
};

benchmark(obj => {
compare(obj);
// console.log(JSON.stringify(obj, null, 2));
// fs.writeFileSync('./scripts/lib/log.json', out);
});
20 changes: 20 additions & 0 deletions scripts/browserTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var exec = require('shelljs').exec;
var browserifyGlob = '"./node_modules/.bin/browserify-glob"';
var fileServer = '"./node_modules/.bin/http-server"';

//run tests on the client-side
var out = './test/client/compiled_tests.js';
var cmd = browserifyGlob + ' "./test/unit/**/*.test.js" ';
cmd += ' -t [ babelify --presets [ env ]] > ' + out;
cmd += ' && ' + fileServer + ' test/client -o -c-1';
exec(cmd);

//then cleanup that god-awful file in our sourcecode
// exec('rm ' + out);


//es5 main (browserify + derequire)
// cmd = lib.browserify + ' "./src/index.js" --standalone nlp';
// cmd += ' | ' + lib.derequire;
// cmd += ' >> ' + path.es5;
// exec(cmd);
Loading

0 comments on commit 2b4f3f5

Please sign in to comment.