Skip to the content

Hikidashi引き出し

Era dates (和暦) and kanji numerals both ways, the dictionary forms of a conjugated word, a reading shared out over its kanji, words pulled from pasted text, and how hard a sentence is to read.

Hikidashi (引き出し) is a drawer: each tool is pulled out when it is wanted. About the name

Contents

Reference

Reading alignment

import { … } from "@johnmorrisdotca/hikidashi/align";

1.1 kB minified and gzipped, with everything it imports (measured with 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.

Exports

NameKindWhat it is
ALIGN_LIMITSconstantWhat segmentWord will work on: a word of up to 64 characters and a reading of up to 256.
buildKanjiTestfunctionThe test: words to write in kanji, then different words to read.
hiraganaToKatakanafunctionHiragana written as katakana: ひらがな to ヒラガナ.
kanjiAsWordfunctionA kanji on its own, as a word a test can ask.
KanjiTesttypeA test: words to write in kanji from their readings, then different words to read.
KanjiTestQuestiontypeOne 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.
katakanaToHiraganafunctionKatakana written as hiragana: カタカナ to かたかな.
ReadWordtypeA word and its reading in hiragana: what buildKanjiTest takes a list of, and what kanjiAsWord makes.
SEGMENT_KINDSconstantWhat a run of a word is: kanji with their part of the reading, kana inside the word, or the kana that end it (okurigana).
SegmentKindtypeOne kind of run: "kanji", "kana" or "okurigana", the values of SEGMENT_KINDS.
segmentWordfunctionA word cut into its kanji and its kana, each kanji run with its share of the reading.
WordSegmenttypeOne run of a word, and its share of the reading in hiragana: what segmentWord cuts a word into.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hikidashi 1.1.0.