本文へ移動

Hikidashi引き出し

和暦と漢数字の相互変換、活用した語の辞書形、漢字への読みの割り当て、貼り付けた文からの単語の抽出、文の難しさ。日本語のテキストを扱う小さな道具を集めた引き出しです。

「引き出し」という名前は、道具が一つずつしまってあり、必要なときに取り出して使える、という意味です。 名前について(英語)

目次

リファレンス · 辞書形

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.

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 { wordClassesOf } from "@johnmorrisdotca/hikidashi/deinflect";

ほかのエクスポート元: @johnmorrisdotca/hikidashi

定義

function wordClassesOf(characters: string, partsOfSpeech: readonly string[]): WordClass[]

引数

名前型説明
charactersstring

The word as the dictionary spells it, such as 来る or 持ってくる.

partsOfSpeechreadonly string[]

The parts of speech the dictionary lists for it, in its own wording or as JMdict tags.

戻り値

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).

例

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' ] []

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/hikidashi 1.1.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。