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

Dictionary forms

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

1.9 kB minified and gzipped, with everything it imports (measured with esbuild)

活用: the dictionary form a conjugated word was written from.

A sentence writes its verbs and adjectives conjugated: 行きます, 食べました, 待って, 高くて. A dictionary lists them as 行く, 食べる, 待つ and 高い. Look a sentence up as it is written and 先生と学校へ行きます finds 行き, a noun meaning "bound for" that is also the stem of the verb, instead of 行く.

This walks a written form back through its endings, one at a time, the way a learner does: 行きませんでした is the polite negative past of 行く; 食べなかった is the past of 食べない, which is the negative of 食べる. Every answer says which kind of word it would have to be, and a caller keeps only the ones its dictionary confirms are that kind, so 行き is never taken for a verb stem when nothing follows it and a noun ending in る is never taken for a verb.

There is deliberately no rule that reads a bare stem as its verb. 東京行き is a noun, and 行き alone is only ever a verb when an ending follows it, which is exactly when a longer rule matches.

Covered: godan and ichidan verbs, い adjectives, and the two irregular verbs する and 来る, in the polite, negative, past, te, conditional, volitional, passive, causative, potential and "wanting" forms and chains of them. Not covered: the imperative, keigo verbs, and な adjectives (which do not conjugate onto themselves).

Exports

NameKindWhat it is
DeinflectiontypeOne answer of dictionaryForms: a dictionary form the written word could come from, and the kind of word it would have to be for that to be true.
dictionaryFormsfunctionEvery dictionary form written could be a conjugation of, with the kind of word it would have to be.
followsAsVerbStemfunctionWhether following opens with an ending that only a verb's stem takes (ます, ました, ません, ましょう, まして, たい, なさい), so that the word before it is being written as a stem.
LONGEST_ENDINGconstantThe longest ending, in characters, that any rule strips, so a caller matching words in running text knows how far past a dictionary word to look for its conjugation.
WORD_CLASSESconstantThe kinds of word a conjugated form can come from, each named by itself: godan and ichidan verbs, iAdjective, and the two irregular verbs suru (する) and kuru (来る).
WordClasstypeOne kind of word: "godan", "ichidan", "iAdjective", "suru" or "kuru", the values of WORD_CLASSES.
wordClassesOffunctionThe kinds of word a dictionary entry is, from the parts of speech it lists, so a conjugated form is only taken for a verb or an adjective the dictionary says is one.

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