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
781 stars 88 forks source link

Please help with this issue. path.join is not a function #108

Open mhqihan opened 1 year ago

mhqihan commented 1 year ago

image image

Hadjimina commented 1 year ago

I have the same issue ☹️

Judy-Nihao commented 1 year ago

I ran into the same error! :(

milimyname commented 10 months ago

Hi everyone.

U can't call packages in the browser. Use them in node js instead.

I use Sveltekit and put them to a page server ts which uses node js in the background.

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

const kuroshiro = new Kuroshiro();

export const load = async () => {
    await kuroshiro.init(new KuromojiAnalyzer());
    const result = await kuroshiro.convert(
        '感じ取れたら手を繋ごう、重なるのは人生のライン and レミリア最高!',
        { to: 'hiragana', mode: 'furigana' }
    );

    return { result };
};