MihaiValentin / lunr-languages

A collection of languages stemmers and stopwords for Lunr Javascript library
Other
430 stars 163 forks source link

Error when initializing `lunr.th.js` #101

Open jinyoungbang opened 1 year ago

jinyoungbang commented 1 year ago

When initializing lunr.th.js, the following error occurs: TypeError: Cannot read properties of undefined (reading 'init').

This seems to be happening to languages that try to use wordcut.js, where the error occurs as the init() function gets called, as shown in this block:

var segmenter = lunr.wordcut;
segmenter.init();

Personally, I think that the wordcut.js is not getting imported into the respective languages and with absolute import, no error seems to occur:

lunr.wordcut = require('./wordcut');
var segmenter = lunr.wordcut;
segmenter.init();

Would love to get some advice or feedback if this would be the right approach to solve the issue!

rennerg commented 10 months ago

I'm having the same problem with lunr.hi.js