Reference · The dictionary forms a conjugated word could come from
deinflectfunction
The dictionary forms a written word could be conjugated from, with the path from each to the word: the endings are taken off one
at a time, outermost first, as a learner does, so 食べなかった is the past of 食べない, which is the negative of 食べる. This
only proposes, from endings alone, so it also proposes forms that are no word (食べなかう); the dictionary says which are real,
by the kind of word each must be. findInflected and inflectedOf ask it. A form is proposed once, by the shortest path that
reaches it. Nothing here fetches, and it never throws.
Import it
import { deinflect } from "@johnmorrisdotca/jisho/deinflect";
Also exported from: @johnmorrisdotca/jisho/words
Definition
function deinflect(text: string): Deinflection[]
Parameters
| Name | Type | Description |
|---|---|---|
text | string | A written word, made plain ( |
Returns
Deinflection[]
The proposals, shortest path first, none for a word no ending fits.
Examples
import { deinflect } from "@johnmorrisdotca/jisho/deinflect";
console.log(deinflect("食べなかった").filter((one) => one.base === "食べる")); // [{ base: "食べる", kind: "i", path: ["negative", "past"] }][ { base: '食べる', kind: 'i', path: [ 'negative', 'past' ] } ]What it prints (run when this page was built)