temp fix for #19 - npm@5 issue
This commit is contained in:
parent
85cc97fdb1
commit
3c88deba7f
|
@ -289,6 +289,9 @@ See [bench/README](bench).
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
|
|
||||||
|
1.1.3
|
||||||
|
- temporary fix for #19 issue with npm@5
|
||||||
|
|
||||||
1.1.2
|
1.1.2
|
||||||
- Fix DeprecationWarning for node 7.x (1.1.1)
|
- Fix DeprecationWarning for node 7.x (1.1.1)
|
||||||
- Fix occasional error for large offsets during seek
|
- Fix occasional error for large offsets during seek
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "wordpos",
|
"name": "wordpos",
|
||||||
|
"version": "1.1.3",
|
||||||
|
"description": "wordpos is a set of part-of-speech utilities for Node.js using the WordNet database.",
|
||||||
"author": "Moos <mooster@42at.com>",
|
"author": "Moos <mooster@42at.com>",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"natural",
|
"natural",
|
||||||
|
@ -10,8 +12,6 @@
|
||||||
"adverbs",
|
"adverbs",
|
||||||
"verbs"
|
"verbs"
|
||||||
],
|
],
|
||||||
"description": "wordpos is a set of part-of-speech utilities for Node.js using the WordNet database.",
|
|
||||||
"version": "1.1.2",
|
|
||||||
"homepage": "https://github.com/moos/wordpos",
|
"homepage": "https://github.com/moos/wordpos",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.12"
|
"node": ">=0.12"
|
||||||
|
|
|
@ -40,18 +40,43 @@
|
||||||
* read index file between the two offsets
|
* read index file between the two offsets
|
||||||
* binary search read data O(log avg)
|
* binary search read data O(log avg)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2012-2016 mooster@42at.com
|
* Copyright (c) 2012-2017 mooster@42at.com
|
||||||
* https://github.com/moos/wordpos
|
* https://github.com/moos/wordpos
|
||||||
*
|
*
|
||||||
* Released under MIT license
|
* Released under MIT license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var
|
||||||
|
fs = require('fs'),
|
||||||
|
path = require('path'),
|
||||||
|
dictPath = path.resolve(__dirname, '..', 'node_modules', 'wordnet-db', 'dict');
|
||||||
|
|
||||||
|
|
||||||
|
// TEMP fix for https://github.com/moos/wordpos/issues/19
|
||||||
|
// Ensure /dict file before continuing
|
||||||
|
var timer = setInterval(check, 750);
|
||||||
|
var tries = 10;
|
||||||
|
process.stdout.write('checking ' + dictPath);
|
||||||
|
function check() {
|
||||||
|
if (fs.existsSync(dictPath)) {
|
||||||
|
clearInterval(timer);
|
||||||
|
process.stdout.write(' ready\n');
|
||||||
|
main();
|
||||||
|
} else if (--tries <= 0) {
|
||||||
|
console.log('\n%s not ready -- see https://github.com/moos/wordpos/issues/19. Abandoning!', dictPath)
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
process.stdout.write(' ' + tries);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
|
||||||
var
|
var
|
||||||
WNdb = require('../src/wordpos').WNdb,
|
WNdb = require('../src/wordpos').WNdb,
|
||||||
util = require('util'),
|
util = require('util'),
|
||||||
BufferedReader = require ('./buffered-reader'),
|
BufferedReader = require ('./buffered-reader'),
|
||||||
_ = require('underscore')._,
|
_ = require('underscore')._,
|
||||||
fs = require('fs'),
|
|
||||||
path = require('path'),
|
|
||||||
KEY_LENGTH = 3,
|
KEY_LENGTH = 3,
|
||||||
stats = true,
|
stats = true,
|
||||||
eofKey = '_EOF_'; // should be unique
|
eofKey = '_EOF_'; // should be unique
|
||||||
|
@ -62,6 +87,7 @@ if (process.argv.length < 3) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_(process.argv.slice(2)).filter(function(arg){
|
_(process.argv.slice(2)).filter(function(arg){
|
||||||
// disable writing stats file
|
// disable writing stats file
|
||||||
if (arg == '--no-stats') {
|
if (arg == '--no-stats') {
|
||||||
|
@ -153,3 +179,5 @@ _(process.argv.slice(2)).filter(function(arg){
|
||||||
})
|
})
|
||||||
.read();
|
.read();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue