wordClassesOffunction
The kinds of word a dictionary entry is, from the parts of speech it lists, so a conjugated form is only taken for a verb or an adjective the dictionary says is one.
Reads plain labels ("godan verb", "ichidan verb", "i-adjective" or "い adjective",
"suru verb" or "する verb"), and JMdict's tags (v5k, v1, adj-i, vs-i, vk), in any case.
A dictionary that lists 来る only as "an intransitive verb" is covered: a verb whose spelling
ends in 来る or くる is a 来る verb.
Import it
import { wordClassesOf } from "@johnmorrisdotca/hikidashi/deinflect";
Also exported from: @johnmorrisdotca/hikidashi
Definition
function wordClassesOf(characters: string, partsOfSpeech: readonly string[]): WordClass[]
Parameters
| Name | Type | Description |
|---|---|---|
characters | string | The word as the dictionary spells it, such as 来る or 持ってくる. |
partsOfSpeech | readonly string[] | The parts of speech the dictionary lists for it, in its own wording or as JMdict tags. |
Returns
WordClass[]
The kinds of word it is, in the order of WORD_CLASSES; an empty list when none of its parts of speech is
a verb or adjective that conjugates here (a noun, a な adjective).
Examples
import { wordClassesOf } from "@johnmorrisdotca/hikidashi/deinflect";
console.log(wordClassesOf("行く", ["v5k-s", "vi"]), wordClassesOf("高い", ["adj-i"]), wordClassesOf("勉強", ["n", "vs-s"]));
console.log(wordClassesOf("持ってくる", ["intransitive verb"]), wordClassesOf("静か", ["adj-na"]));[ 'godan' ] [ 'iAdjective' ] [ 'suru' ]
[ 'kuru' ] []What it prints (run when this page was built)