Tuesday, 26 January 2021

Import a specific part from natural library (webpack)

I am using the npm natural library for tokenization and only use it in one line, as shown below:

let token = natural.StemmerJa.prototype.tokenizeAndStem(searchWord, true);

However, I wasn't sure how to import it in webpack since tokenizeAndStem seems like a method of the natural object.

I'm importing it like this:

import natural from "natural";

Is there any way I can just get StemmerJa's tokenizeAndStem? This is because my current app builds the whole library and it's making load times quite slow.

Any guidance will be appreciated. Thanks.



from Import a specific part from natural library (webpack)

No comments:

Post a Comment