Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Use Intl.Segmenter to reduce bundle size in browsers #90

Open
knubie opened this issue Nov 4, 2022 · 0 comments
Open

Idea: Use Intl.Segmenter to reduce bundle size in browsers #90

knubie opened this issue Nov 4, 2022 · 0 comments

Comments

@knubie
Copy link

knubie commented Nov 4, 2022

Right now lunr-languages uses the default white-space-based stemmer for most languages, and handful of custom stemers for other languages (th, ja, zh). Additionally, the zh stemmer is only available in Node.js because it uses C++ extensions.

We could reduce bundle size, and make zh usable in the browser by switching to Intl.Segmenter for all languages.

The downside to this approach is that Firefox is the only major browser that has not implemented the Stemmer API, and we would also lose support for Node.js, which would be a deal breaker.

I have a working proof of concept here where I use the stemmer specifically for zh to gain the ability to use it in browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant