GithubHelp home page GithubHelp logo

Comments (5)

xissy avatar xissy commented on June 3, 2024

Sorry to hear, @latkinso42.
Could you write your code here? Let me inspect the problem please.

from node-stanford-simple-nlp.

latkinso42 avatar latkinso42 commented on June 3, 2024

So it seems this was a java CLASSPATH issue. There was a difference in the errors from the Async technique and the Sync technique, but this is most likely due to the loadPipeline requirement. Both are working now, for me.

My node app.js employs a typical routes.js for get and post. The callback for the post calls a handler which uses either the async or sync method as below. The post callback generally renders the output from the results of the parser and the params contain the text query:

var StanfordSimpleNLP = require('../../lib/StanfordSimpleNLP');

// ASYNC
exports.parsePhrase = function(params, callback) {
var ssnlp=new StanfordSimpleNLP( function(err) {
ssnlp.process(params.tquery, callback);
});
}

// SYNC
exports.parsePhrase = function(params, callback) {
var stanfordSimpleNLP = new StanfordSimpleNLP(null, callback);
stanfordSimpleNLP.loadPipelineSync();
stanfordSimpleNLP.process(params.tquery, function(err, result) {
callback(err, result);});
}

Every thing works either way!
Thanks!

from node-stanford-simple-nlp.

xissy avatar xissy commented on June 3, 2024

Good job!
I know that the setting java & node-java is not easy in some environments.

from node-stanford-simple-nlp.

hypersundays avatar hypersundays commented on June 3, 2024

I'm having a problem using the node wrapper.

When I use this:
var stanfordSimpleNLP = new StanfordSimpleNLP.StanfordSimpleNLP(function(err, callback) {
stanfordSimpleNLP.process('This is so good.', function(err, result) {
console.log(err, result);
if (err){
return err;
}
console.log(result);
});

I get the 'load a pipeline first' error.

When I use this:

var stanfordSimpleNLP = new StanfordSimpleNLP(function(err){
// same code as above

I get the object is not a function TypeError.

I'm trying to find a way to make this work but I can't quite understand where to go from here.

from node-stanford-simple-nlp.

Izhaki avatar Izhaki commented on June 3, 2024

Same issue as @hypersundays. Extracting the slp zip into the jar folder solved it.

See https://github.com/xissy/node-stanford-simple-nlp/tree/master/jar

from node-stanford-simple-nlp.

Related Issues (15)

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.