GithubHelp home page GithubHelp logo

lemmer's People

Contributors

a0viedo avatar bensalilijames avatar scarygami avatar silentrob avatar vanm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lemmer's Issues

I got this issue today trying to install Lemmer, crashed my whole project

.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)

Saving to file lemmer results

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)
        })
    })
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.