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

errors with demo #90

Open GravesDXD opened 2 years ago

GravesDXD commented 2 years ago

I copy the demo code , but it doesn't run well in React. react version is the latest. node version is 17.0.2. const Jp = () => { let [id,]=React.useState('') // Instantiate React.useEffect(() => { demo() }, [id]);

async function demo (params) { const kuroshiro = new Kuroshiro(); // Initialize // Here uses async/await, you could also use Promise await kuroshiro.init(new KuromojiAnalyzer()); // Convert what you want const result = await kuroshiro.convert("感じ取れたら手を繋ごう、重なるのは人生のライン and レミリア最高!", { to: "hiragana" }); console.log(result) } return

123
; };

export default Jp; ![捕获](https://user-images.githubusercontent.com/33920719/148052248-9268c67d-0a7a-444e-b7ba-f9d7f7335c07.PNG)