リファレンス
読みの割り当て
import { … } from "@johnmorrisdotca/hikidashi/align";
最小化と gzip 圧縮をしたサイズは 1.1 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
読みの割り当て: a word's reading shared out over its kanji, the way a school's かん字テスト sets it.
A reading beside empty squares, the kanji written in the squares and the okurigana in brackets under them. 食べる read たべる is 食 (た) and べる; 形が合う read かたちがあう is 形 (かたち), が, 合 (あ), う. The kana a word is written with are anchors in its reading, which is what lets the rest be shared out between the kanji. This is the part a worksheet, a flashcard that blanks the kanji, or a ruby annotator needs, with nothing to look up.
A test has a writing half (see the reading, write the kanji) and a reading half (see the kanji, write
the reading), drawn from the same words. buildKanjiTest makes both from a list, the same test for
the same seed.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
ALIGN_LIMITS | 定数 | What segmentWord will work on: a word of up to 64 characters and a reading of up to 256. |
buildKanjiTest | 関数 | The test: words to write in kanji, then different words to read. |
hiraganaToKatakana | 関数 | Hiragana written as katakana: ひらがな to ヒラガナ. |
kanjiAsWord | 関数 | A kanji on its own, as a word a test can ask. |
KanjiTest | 型 | A test: words to write in kanji from their readings, then different words to read. |
KanjiTestQuestion | 型 | One question of a test: the word, its reading, and the word cut into its segments, ready to be drawn as squares with the okurigana in brackets. |
katakanaToHiragana | 関数 | Katakana written as hiragana: カタカナ to かたかな. |
ReadWord | 型 | A word and its reading in hiragana: what buildKanjiTest takes a list of, and what kanjiAsWord makes. |
SEGMENT_KINDS | 定数 | What a run of a word is: kanji with their part of the reading, kana inside the word, or the kana that end it (okurigana). |
SegmentKind | 型 | One kind of run: "kanji", "kana" or "okurigana", the values of SEGMENT_KINDS. |
segmentWord | 関数 | A word cut into its kanji and its kana, each kanji run with its share of the reading. |
WordSegment | 型 | One run of a word, and its share of the reading in hiragana: what segmentWord cuts a word into. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。