MihaiValentin / lunr-languages

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

lunr.TinySegmenter is not a constructor on lunr.ja file #63

Closed joanv38 closed 4 years ago

joanv38 commented 4 years ago

Hello, I require your help if someone already saw this problem. I use mkdocs and so to build the search I specify the lang with ja. I tried with 5 or 6 different language, all work except this one, this error is show all the time: lunr.TinySegmenter is not a constructor at lunr.ja.js:86 at lunr.ja.js:36 at lunr.ja.js:38 at loadScripts (worker.js:29) at XMLHttpRequest.onJSONLoaded (worker.js:53) Does someone already saw this error and found a way to fix it?

I'm still working on it so if I find the solution I will post it. Thank you

joanv38 commented 4 years ago

Ok so at the end it's because mkdocs build doesn't import the tinyseg.js and of course doesn't load it(so this issues is not with lunr but with mkdocs. Just for information, a manual import + add the line if (lang[i] != 'en') { scriptsToLoad.push('tinyseg.js'); } on worker.js will fix it.

Kind regards