I have been using a thesaurus API from altervista for my JavaScript web application, but I am looking to host my own thesaurus on my web server. This way, I can make numerous synonym requests without worrying about API limitations. My goal is to be able to send words and receive their synonyms directly from JavaScript in the browser.
In my exploration, I experimented with node.js and successfully retrieved synonyms using two packages: "natural" and "wordnet-magic". However, when I attempted to browserify these node packages, I encountered some challenges.
When trying to browserify "natural," I received an error stating:
"Error: Cannot find module 'lapack'"
It appears that "lapack" is not compatible with browserify due to being a native OS-dependent shared library.
Similarly, I faced issues with browserifying "wordnet-magic," resulting in the error:
"Uncaught TypeError: Cannot read property '_ansicursor' of undefined"
This problem could be related to sqlite3, as similar errors have been reported and remain unsolved.
If achieving this functionality in JavaScript proves too complex, my alternative would be exploring a PHP solution. While it doesn't necessarily require Browserify or Wordnet, having Wordnet accessible in the browser would be incredibly beneficial. Thank you.