dictionaryForms関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { dictionaryForms } from "@johnmorrisdotca/hikidashi/deinflect";
ほかのエクスポート元: @johnmorrisdotca/hikidashi
定義
function dictionaryForms(written: string): Deinflection[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
written | string | A verb or adjective as a sentence writes it: 食べませんでした, 行きます, 高くて, 持ってきた. |
戻り値
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.
例
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' }
[]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。