Closed Takiyo0 closed 3 years ago
I also had this error but it works great after initializing with an analyzer
try this one:
const Kuroshiro = require('kuroshiro');
const kuroshiro = new Kuroshiro();
const KuromojiAnalyzer = require('kuroshiro-analyzer-kuromoji');
const analyzer = new KuromojiAnalyzer();
async function init() {
await kuroshiro.init(analyzer);
}
async function toRomaji(string) {
return await kuroshiro.convert(string, { to: "romaji", romajiSystem: "passport" });
}
init().then(() => {
toRomaji("創造は始まりの風を連れて").then(str => console.log(str));
toRomaji("月曜日のクリームソーダ").then(str => console.log(str));
});
result:
sozowahajimarinokazeotsurete
getsuyobinokurimusoda
ah yes, thanks :D
Anyone know why i get this error? i use code from readme, this is my code
and this is the error
did i miss some code? please let me know. thanks