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

SEGMENT_KINDSconstant

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). The kind of every WordSegment is one of these.

Import it

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

Also exported from: @johnmorrisdotca/hikidashi

Definition

const SEGMENT_KINDS: { readonly kanji: "kanji"; readonly kana: "kana"; readonly okurigana: "okurigana"; } = {
    kanji: "kanji",
    kana: "kana",
    okurigana: "okurigana",
} as const

Members

NameTypeDescription
kanji"kanji"

Kanji, with the part of the reading they carry.

kana"kana"

Kana inside a word, given on the paper as written.

okurigana"okurigana"

Kana that end a word after its kanji: written in the brackets.

Examples

import { SEGMENT_KINDS, segmentWord } from "@johnmorrisdotca/hikidashi/align";

const parts = segmentWord("食べる", "たべる") ?? [];
console.log(parts.filter((part) => part.kind === SEGMENT_KINDS.okurigana).map((part) => part.text));
[ 'べる' ]

What it prints (run when this page was built)

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