kuromoji.js icon indicating copy to clipboard operation
kuromoji.js copied to clipboard

Can not load dict from external URL

Open georgeOsdDev opened this issue 5 years ago • 2 comments

We are trying to use kuromoji.js with kuromojin on browser. When we use external url as dicPath option, double slash is normalized by path.join.

> require("path").join("http://external-url.com/dict", "base.dat.gz");
'http:/external-url.com/dict/base.dat.gz'

So XMLHttpRequest will go to https://mydomain.com/external-url.com/dict/base.dat.gz And fail to load dict.

Screen Shot 2020-01-29 at 4 51 25 AM Screen Shot 2020-01-29 at 4 52 27 AM

georgeOsdDev avatar Jan 28 '20 19:01 georgeOsdDev

@georgeOsdDev im having the same issue. im using kuroshiro to change kanji to furigana however when i try to use external cdn for the dict path. it seems to work fine on localhost but not on live server. did u find any workaround for this issue? if so would help me?

chinenvinicius avatar Sep 24 '22 17:09 chinenvinicius

@chinenvinicius You could find some solutions linked on this thread. My workaround is https://github.com/mobilusoss/textlint-browser-runner/pull/7

georgeOsdDev avatar Sep 24 '22 20:09 georgeOsdDev