diff options
Diffstat (limited to 'examples/reading-correction-break.ts')
-rw-r--r-- | examples/reading-correction-break.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/reading-correction-break.ts b/examples/reading-correction-break.ts index 6761165..a72e545 100644 --- a/examples/reading-correction-break.ts +++ b/examples/reading-correction-break.ts @@ -1,23 +1,23 @@ import Yomikun from "../api/yomikun.ts"; import DirectCoreClient from "../core/direct/client.ts"; -// WIP - // Create a direct (local) API instance var api = new Yomikun(new DirectCoreClient()); // Explicitly wait until everything is ready (not required) await api.ready; -// index sentence (generates wrong readings) -var sentence = await api.sentence("日本に来て一番驚いたことは自動販売機の多さだ。"); +// index sentence (generates wrong reading for 「この辺に」) +var sentence = await api.sentence("やっぱりこの辺にある武器も朽ちてるみたいだし"); // generated reading (wrong) console.log(sentence.furigana()); -// insert parser break -sentence.break(sentence.at("漢字")); +// insert parser break in the middle of a (wrong) expression +await sentence.break(sentence.at("この辺") + 2); // generated reading (correct) console.log(sentence.furigana()); +// TODO: this is a bad example, find an example that uses adjacent kanji that +// can become a larger compound, but should be two separate words. |