fergiemcdowall / stopword

A module for node.js and the browser that takes in text and strips it of stopwords
MIT License
231 stars 34 forks source link

Possible to load languages dynamically? #322

Closed msageryd closed 2 months ago

msageryd commented 2 months ago

I'm writing an Obsidian plugin and would like to give the user a list of languages to remove stopwords for. Is it possible to load these languages dynamically?

My plugin is currently written in commin JS, but I will switch to ESM if dynamic loading is easier that way.

Edit: Correction. I see now that Obsidian does not seem to support ESM plugins.

eklem commented 2 months ago

Not sure if I answer your question, but you can bundle it without languages and then have something that loads a language when you need it?

msageryd commented 2 months ago

Thanks. I ended up transforming the language files to CommonJS in my esbuild script and bundled the transformed versions.