deinflect関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { deinflect } from "@johnmorrisdotca/jisho/deinflect";
ほかのエクスポート元: @johnmorrisdotca/jisho/words
定義
function deinflect(text: string): Deinflection[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | A written word, made plain ( |
戻り値
Deinflection[]
The proposals, shortest path first, none for a word no ending fits.
例
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' ] } ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。