hexenq / kuroshiro

Japanese language library for converting Japanese sentence to Hiragana, Katakana or Romaji with furigana and okurigana modes supported.
https://kuroshiro.org
MIT License
818 stars 93 forks source link

Not found errors in Browser #86

Open Code-Kat opened 2 years ago

Code-Kat commented 2 years ago

GET http://localhost:3000/url/to/dictFiles/base.dat.gz 404 (Not Found) GET http://localhost:3000/url/to/dictFiles/unk_pos.dat.gz404 (Not Found)

I am getting about 30 errors such as the ones above in my console when I try to use kuroshiro.

I have installed kuroshiro, kuroshiro-analyzer-kuromoji, and kuromiji through npm. Framework: Next.js

import Kuroshiro from "kuroshiro";
import KuromojiAnalyzer from "kuroshiro-analyzer-kuromoji";

export const kanjiToRomaji = async (kanji: string) => {
  const kuroshiro = new Kuroshiro();
  await kuroshiro.init(new KuromojiAnalyzer());
  const romaji = await kuroshiro.convert(kanji, { to: "romaji" });
  return romaji;
};
jgaynor17 commented 1 year ago

did you solve this?

owen-will-m commented 1 year ago

also looking for a solution to this

cyfung1031 commented 1 year ago

You can clone the dicts file from kuromoji's npm