MihaiValentin / lunr-languages

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

load nodejieba dict on init #82

Open lianzhao opened 3 years ago

lianzhao commented 3 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.