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.
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, thezh
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 toIntl.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.