Reference · Look words up by reading, written form, English meaning, kanji or romaji
findInflectedfunction
Looks a text up as it is written or as a conjugated form: 食べなかった finds 食べる, with the path "negative, past". It loads the
text and the dictionary forms its ending could come from (a few pieces, about 25 kB gzipped each, where a plain lookup costs
one or two), and keeps those that are the kind of word the ending needs. See inflectedOf for the details, and
deinflect for the endings.
Import it
import { findInflected } from "@johnmorrisdotca/jisho/words";
Definition
function findInflected(text: string, options?: Omit<LoadWordsOptions, "previous" | "inflected">): Promise<InflectedWord[]>
Parameters
| Name | Type | Description |
|---|---|---|
text | string | A reading or a written form, conjugated or not. |
options (optional) | Omit<LoadWordsOptions, "previous" | "inflected"> | The mode, the lists and |
Returns
Promise<InflectedWord[]>
The words with their paths, the text's own first.
Examples
import { findInflected } from "@johnmorrisdotca/jisho/words";
const found = await findInflected("食べなかった");
console.log(found[0]?.word.written, found[0]?.path.join(", ")); // 食べる negative, past食べる negative, pastWhat it prints (run when this page was built)