MihaiValentin / lunr-languages

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

load nodejieba dict on init #82

Open lianzhao opened 2 years ago

lianzhao commented 2 years ago

lunr.zh.js will try to load nodejieba dict on EVERY tokenization call currently. So CPU usage will be 100% while indexing a Chinese document with custom a nodejieba dict. https://github.com/MihaiValentin/lunr-languages/blob/177653fb567006478ccb0ab6920b78eb77cad14e/lunr.zh.js#L87-L93

I think the dict should only be loaded once at initialization.