digitalheir / probabilistic-earley-parser-javascript

🎲 An efficient implementation of a probabilistic Context Free Grammar parser in Javascript
MIT License
55 stars 3 forks source link

Error: Cannot find module 'semiring/abstract-expression/atom' #6

Open gimite opened 6 years ago

gimite commented 6 years ago

I'm interesting in using this package, but I found that it doesn't work with the latest version (1.2.7) of semiring package, at least when I use it from normal JavaScript.

This is because abstract-expression/atom.js is no longer included in semiring package. I was able to make it work by downgrading semiring to 1.2.3.

$ node --version
v9.10.1
$ npm init -y   
$ npm install probabilistic-earley-parser
+ probabilistic-earley-parser@0.9.6
$ npm list
...
  └── semiring@1.2.7
$ node
> require('probabilistic-earley-parser')
Error: Cannot find module 'semiring/abstract-expression/atom'
    at Function.Module._resolveFilename (module.js:543:15)
    at Function.Module._load (module.js:470:25)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
$ npm install semiring@1.2.3     
$ node
> require('probabilistic-earley-parser')
{ addState: [Function: addState],
...

Thanks for the package anyway!

digitalheir commented 6 years ago

Thanks, will fix when I get behind a computer. Probably after 7 days.

digitalheir commented 6 years ago

Also this project doesn't have some optimizations and error handling goodies that the java version has. Could you describe your use case? Maybe it would be fruitful to port those features too.

gimite commented 6 years ago

Thanks for the reply! I'm thinking of using this package to prototype my app which interprets small subset of English (it's like a chat bot). It's probably OK for my purpose to miss such features, but I will let you know if I encounter any issues.

I posted one question #7 which I encountered while using the package.