リファレンス
辞書形
import { … } from "@johnmorrisdotca/hikidashi/deinflect";
最小化と gzip 圧縮をしたサイズは 1.9 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
活用: the dictionary form a conjugated word was written from.
A sentence writes its verbs and adjectives conjugated: 行きます, 食べました, 待って, 高くて. A dictionary lists them as 行く, 食べる, 待つ and 高い. Look a sentence up as it is written and 先生と学校へ行きます finds 行き, a noun meaning "bound for" that is also the stem of the verb, instead of 行く.
This walks a written form back through its endings, one at a time, the way a learner does: 行きませんでした is the polite negative past of 行く; 食べなかった is the past of 食べない, which is the negative of 食べる. Every answer says which kind of word it would have to be, and a caller keeps only the ones its dictionary confirms are that kind, so 行き is never taken for a verb stem when nothing follows it and a noun ending in る is never taken for a verb.
There is deliberately no rule that reads a bare stem as its verb. 東京行き is a noun, and 行き alone is only ever a verb when an ending follows it, which is exactly when a longer rule matches.
Covered: godan and ichidan verbs, い adjectives, and the two irregular verbs する and 来る, in the polite, negative, past, te, conditional, volitional, passive, causative, potential and "wanting" forms and chains of them. Not covered: the imperative, keigo verbs, and な adjectives (which do not conjugate onto themselves).
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
Deinflection | 型 | One answer of dictionaryForms: a dictionary form the written word could come from, and the kind of word it would have to be for that to be true. |
dictionaryForms | 関数 | Every dictionary form written could be a conjugation of, with the kind of word it would have to be. |
followsAsVerbStem | 関数 | Whether following opens with an ending that only a verb's stem takes (ます, ました, ません, ましょう, まして, たい, なさい), so that the word before it is being written as a stem. |
LONGEST_ENDING | 定数 | The longest ending, in characters, that any rule strips, so a caller matching words in running text knows how far past a dictionary word to look for its conjugation. |
WORD_CLASSES | 定数 | The kinds of word a conjugated form can come from, each named by itself: godan and ichidan verbs, iAdjective, and the two irregular verbs suru (する) and kuru (来る). |
WordClass | 型 | One kind of word: "godan", "ichidan", "iAdjective", "suru" or "kuru", the values of WORD_CLASSES. |
wordClassesOf | 関数 | 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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。