natural icon indicating copy to clipboard operation
natural copied to clipboard

Not compatible with electron?

Open lagartoverde opened this issue 6 years ago • 3 comments

Hi, I get this error using the library, I'm trying to use the natural Porter stemmer and the sentence tokeniser and in both of them I get the same error

Uncaught Error: ENOENT: no such file or directory, open '//../../../../data/kata-dasar.txt'
    at Object.fs.openSync (fs.js:652:18)
    at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:172:20)
    at Object.fs.readFileSync (fs.js:553:33)
    at Object.fs.readFileSync (ELECTRON_ASAR.js:508:29)

Thank you.

lagartoverde avatar Mar 09 '18 21:03 lagartoverde

Are you using the Indonesian stemmer? It seems so because it needs kata-dasar.txt. Could you elaborate a bit more about what you did? And how you required the stemmer? Some code would help to solve this.

Hugo

Hugo-ter-Doest avatar Apr 08 '18 19:04 Hugo-ter-Doest

I can confirm this error with either

import {SentenceAnalyzer, PorterStemmer} from 'natural';
const analyzer = new SentenceAnalyzer("English", PorterStemmer, "afinn");

or the same codes as in README.md

I don't really need the Indonesian stemmer

wandonye avatar May 11 '18 03:05 wandonye

I think you mean SentimentAnalyzer, and not SentenceAnalyzer...

Anyway, the path to the file kata-dasar.txt is wrong, because it has two leading //. Is it possible that electron handles this path wrong? Maybe because it is in a strange place above the folder of the indonesian stemmer?

Hugo

Hugo-ter-Doest avatar May 12 '18 07:05 Hugo-ter-Doest