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

kanjiAsWordfunction

A kanji on its own, as a word a test can ask.

A dictionary marks okurigana with a dot - た.べる for 食 - so 食 becomes 食べる read たべる, the question a worksheet would ask. A reading without one is the kanji's own word (牛, うし), and a kanji with no kun reading is asked by its on reading (門, もん). Prefix and suffix forms (-び) are passed over.

Import it

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

Also exported from: @johnmorrisdotca/hikidashi

Definition

function kanjiAsWord(kanji: string, kun: readonly string[], on: readonly string[]): ReadWord | null

Parameters

NameTypeDescription
kanjistring

One kanji.

kunreadonly string[]

Its kun readings as a dictionary lists them, okurigana after a dot (た.べる) and prefix or suffix forms with a hyphen.

onreadonly string[]

Its on readings, in katakana or hiragana.

Returns

ReadWord | null

The word to ask and its reading in hiragana; null for a kanji with neither a kun nor an on reading.

Examples

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

console.log(kanjiAsWord("食", ["た.べる", "く.う"], ["ショク"]), kanjiAsWord("牛", ["うし"], ["ギュウ"]));
console.log(kanjiAsWord("門", [], ["モン"]), kanjiAsWord("〆", [], []));
{ word: '食べる', reading: 'たべる' } { word: '牛', reading: 'うし' }
{ word: '門', reading: 'もん' } null

What it prints (run when this page was built)

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