superscriptjs / lemmer Goto Github PK
View Code? Open in Web Editor NEWEnglish Lemmer interface for Node.js
License: MIT License
English Lemmer interface for Node.js
License: MIT License
.pipe(tar.Extract({ path: __dirname }))
TypeError: tar.Extract is not a function
at extractTarball (/app/node_modules/lemmer/node_modules/wndb-with-exceptions/unpack.js:52:15)
at Object. (/app/node_modules/lemmer/node_modules/wndb-with-exceptions/unpack.js:58:1)
at Module._compile (module.js:409:26)
Hi,
I used lemmer to lemmatize a vector of 20K words and then wanted to save the results to a file. I receive an error saying "Error: EMFILE: too many open files, open 'c:\lemmered.txt'". When I am saving the original tokens vector (same number of words). It seems that it is a problem with the Lemmer.lemmatize function.
Do you know what can be the problem?
I tried many different ways of rewriting this and it seems that there is some part of the lemmer that afflicts the ability to write a file even after it has finished.
var Lemmer = require('lemmer');
const fs = require('fs');
let textFilePath = "C:/Qanta/leadgenPilot/OpenWhisk/sandBox/barc_text[9047].txt";
readFileIK(textFilePath) // this uses readFile as a promise resolving with the data
.then(data => {
let tokens = data
// .substring(1,10000)
.toLowerCase().split(/\W/g);
Lemmer.lemmatize(tokens, function (err, wordsArray) {
if (err) {
console.log(err)
throw (err)
} else {
let a = wordsArray.toString();
console.log("lemmered ", wordsArray.length, "now will write to file")
fs.writeFile("lemmered.txt", a, (err) => {
if (err) {
console.log("error writing file ", err)
} else {
console.log("GREAT SUCCESS")
}
})
}
})
})
function readFileIK(textFilePath) {
return new Promise(function (resolve, reject) {
fs.readFile(textFilePath, 'utf8', function (err, data) {
if (err)
reject(err)
resolve(data)
})
})
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.