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

dictionaryFormsfunction

Every dictionary form written could be a conjugation of, with the kind of word it would have to be. The written form itself is not among them: a word written as the catalogue lists it is the caller's plain match.

Likeliest first: the reading that accounts for more of the written ending leads, so 食べました is 食べる (ました) before it is 食べます (した). A caller that cannot check the kind of word tries them in this order.

Import it

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

Also exported from: @johnmorrisdotca/hikidashi

Definition

function dictionaryForms(written: string): Deinflection[]

Parameters

NameTypeDescription
writtenstring

A verb or adjective as a sentence writes it: 食べませんでした, 行きます, 高くて, 持ってきた.

Returns

Deinflection[]

Every dictionary form it could be a conjugation of, each with its kind of word, likeliest first; an empty list when no ending matches (a noun, or a word already in its dictionary form). Each is a proposal for your dictionary to confirm, not an answer.

Examples

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

console.log(dictionaryForms("食べませんでした").slice(0, 2));
console.log(dictionaryForms("行きました")[0], dictionaryForms("持ってきた")[0]);
console.log(dictionaryForms("学校"));
[
  { base: '食べる', wordClass: 'ichidan' },
  { base: '食ぶ', wordClass: 'godan' }
]
{ base: '行く', wordClass: 'godan' } { base: '持ってくる', wordClass: 'kuru' }
[]

What it prints (run when this page was built)

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