Giter Club home page Giter Club logo

Comments (2)

johntiger1 avatar johntiger1 commented on July 28, 2024 1

This is what GPT4 is saying:
"You are correct that the natural library is not designed to be used directly from the client-side in a browser environment. The main reason is that it was developed as a Node.js package, specifically targeting server-side usage. Node.js packages are built around the CommonJS module system, which relies on the require() function to import modules. This is not natively supported in browsers, which use the ECMAScript (ES) module system with import and export statements.

Additionally, some Node.js packages, like natural, may depend on other Node.js-specific features or APIs that are not available in the browser environment. This can make it challenging or even impossible to use such packages directly in the browser without modification.

To use a Node.js package like natural in a browser environment, you can use a bundler like Webpack or Browserify. These tools can bundle the required modules and their dependencies into a single JavaScript file that can be included in your HTML file using a script tag.

However, please note that using a bundler does not guarantee that all features of the library will work as expected, as there might still be compatibility issues between the Node.js package and the browser environment. In such cases, it's better to look for alternative libraries that are designed to work in a browser environment, like the compromise library mentioned in a previous response."

could someone confirm? sorry, not super familiar with the webdev environment

from natural.

Hugo-ter-Doest avatar Hugo-ter-Doest commented on July 28, 2024

Yes, you can use webpack to use Natural client side. See the webpack.config.js that is in the root of the repo. It may well be a good starting point. I use the webpack configuration for testing in the browser using jasmineBrowser.

from natural.

Related Issues (20)

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.