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
| Name | Type | Description |
|---|---|---|
written | string | 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)