リファレンス
読み、表記、英語の意味、漢字、ローマ字から単語を引く
import { … } from "@johnmorrisdotca/jisho/words";
最小化と gzip 圧縮をしたサイズは 14897.9 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Words: the Japanese words of JMdict, looked up by reading (かみ) or by written form (紙), by what they mean in English or by a kanji in them, each with a short English meaning, its senses with the marks JMdict gives them, and how common it is. The table is cut into small pieces and a lookup fetches only the pieces it needs, so a page asks for one word and downloads a few kilobytes, not the dictionary. Import this entry only where a lookup is made: a server that bundles it carries every piece.
The parts are in words-load.ts (fetching), words-lookup.ts (reading what was fetched), words-search.ts (by meaning and by
kanji), words-common.ts (the common words as one table), words-pieces.ts (the pieces and the error), words-rows.ts and
words-text.ts (what a row and a text are), words-filter.ts (the tools for what a lookup returned) and romaji.ts.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
allWords | 関数 | Every word that has been loaded, once each, the commonest first for the common table. |
commonestFirst | 関数 | The words with the commonest first, by their rank. |
deinflect | 関数 | The dictionary forms a written word could be conjugated from, with the path from each to the word: the endings are taken off one at a time, outermost first, as a learner does, so 食べなかった is the past of 食べない, which is the negative of 食べる. |
Deinflection | 型 | One way a written word could be a conjugated dictionary word. |
DeinflectKind | 型 | The kind of word a dictionary form must be, as the letters of a Word's kinds: g godan, i ichidan, a i-adjective, n na-adjective, s suru, k kuru. |
findByMeaning | 関数 | Words found by what they mean in English, the best answers first. |
findInflected | 関数 | Looks a text up as it is written or as a conjugated form: 食べなかった finds 食べる, with the path "negative, past". |
FindOptions | 型 | How findByMeaning and wordsWithKanji are asked: the mode and the lists, as for a lookup, and how many words to give. |
foldKana | 関数 | A text folded to hiragana: the katakana move down, ー and everything else stay. |
furiganaOf | 関数 | The pieces of a written word with the kana that read each kanji: 食べる read たべる is 食 (た) and べる. |
furiganaOfSurface | 関数 | The pieces of a word as it is written in a text, which may be a conjugated form of the dictionary form it was found by: 食べなかった from 食べる (たべる) is 食 (た) and べなかった. |
FuriganaPart | 型 | One piece of a written word: its text, and, for a piece of kanji, the kana that read it. |
hasMarks | 関数 | Whether a word has a sense that carries any of some marks. |
IndexManifest | 型 | Where the pieces of the indexes are that find words by meaning and by kanji. |
inflectedOf | 関数 | The words for a text that is a word as it is written or a conjugated form of one, from words loaded with inflected: true: the words the dictionary has for the text itself first (path empty), then each word its ending could come from, and only those of the kind the ending needs, so 食べた finds 食べる (an ichidan verb) and never 食べた's other readings of the ending. |
InflectedWord | 型 | A word found for a text, and how the text comes from it. |
isLoaded | 関数 | Whether a text has been loaded, so that wordsOf can answer for it. |
kanaFromRomaji | 関数 | Every hiragana text a romaji can read as, the usual first: one, unless it writes a long vowel with a macron or a circumflex, which a reading writes more than one way. |
KanjiFact | 型 | What the kanji tables say of one kanji in a text. |
kanjiOfWord | 関数 | The entries of the kanji table for the kanji a word is written with, once each, in the order they appear: so a word can show its kanji with their grade, JLPT level, readings and meanings. |
loadCommonWords | 関数 | The common words, fetched in one piece: about 26,000 rows and some 800 kB gzipped, for a page that looks up many words, all of them common. |
loadWords | 関数 | Fetches what JMdict holds for some texts, and nothing else: the pieces of the table those texts are in, about 25 kB gzipped each, so that wordsOf can then answer for them with no waiting. |
LoadWordsOptions | 型 | How loadWords is asked. |
LookupOptions | 型 | How a lookup in loaded words is asked. |
MAX_READ_LENGTH | 定数 | The most characters readText reads; the rest is left out and truncated says so. |
meaningFrom | 関数 | The short English meaning of some senses: up to two senses of up to three glosses, ", " between glosses and "; " between senses, cut at a whole gloss inside 60 characters. |
meaningOf | 関数 | The meaning of the commonest word a text has, or null: a text with no word, or none that the mode and the lists let through, has no meaning, and the answer is never a placeholder. |
normalizeText | 関数 | A text made plain for a lookup: composed and compatibility forms folded together (NFKC, so full-width letters and digits become half-width and half-width kana full-width), whitespace collapsed to single spaces and trimmed, spaces beside Japanese removed, invisible and control characters removed, and a dash between kana, or ending kana, made the long vowel mark ー. |
onlyWords | 関数 | Only the words named on a list. |
PackedPatch | 型 | What to do to the common words that safe mode keeps to have every common word as JMdict has it: each edit is a position, then "r" to replace the row there or "i" to insert one before it, then the row, apart by tabs. |
PackedWords | 型 | A table of words as an entry point exports it: where it was made from, the JMdict release, and one string a row. |
PieceSet | 型 | The pieces of one kind: the first key of each, in order, and how to fetch each. |
priorityTags | 関数 | The priority tags a row stores, as JMdict writes them. |
rankOfTags | 関数 | One number for how common a word is, lower being commoner, made from its priority tags the way JMdict's own bands go: the newspaper band if it has one (nf01 is 250, and each band adds 500), else 12,000 for the first grade of any list and 24,000 for the second, else 100,000 for a word with no priority. |
readCommonWords | 関数 | The common words as a table the caller already has, read into words: a lookup by reading or written form with no waiting. |
ReadResult | 型 | What readText gives. |
readRow | 関数 | A row read out of the string it is stored as. |
readText | 関数 | Reads a text: it is cut into words by taking, from each place, the longest stretch that the dictionary has a word for, either as it stands or as a conjugated form (食べなかった is 食べる). |
ReadToken | 型 | One piece of a text that readText cut out: a word of the dictionary, a stretch of Japanese no word was found for, or something that is not Japanese (spaces, punctuation, Latin letters, digits), which is kept so that the pieces put together are the text. |
romajiToKana | 関数 | A romaji as the hiragana it usually reads as: kami is かみ, shinbun is しんぶん, Tōkyō is とうきょう. |
SAFE_MARKS | 定数 | The marks that safe mode leaves out, which are those JMdict gives a sense that is vulgar (vulg), X-rated (X), sensitive (sens) or derogatory (derog). |
searchMeanings | 関数 | The words already loaded whose English meaning holds some words, the whole word at a time (water is a gloss with the word water in it, watermelon is not), the ones whose first gloss is exactly it first, then those with another gloss that is, then the commonest. |
Sense | 型 | One sense of a word: the marks JMdict gives it, and its glosses, the plain one first. |
studyList | 関数 | The words of a text that was read, once each in the order they came, each with how often it came and the form it first came in. |
studyListText | 関数 | A study list as text: csv has a header line and quotes what needs it, for a spreadsheet; tsv has no header and tabs, to paste into a spreadsheet or to import into a flashcard program. |
StudyRow | 型 | One word of a study list. |
Suggestion | 型 | A word suggestWords found, and how many slips from what was typed it is. |
suggestWords | 関数 | The common words nearest to a text that may have a typo in it, the exact ones first and then those one slip away, the commonest first. |
withoutMarks | 関数 | The words with the senses that carry any of some marks left out. |
withoutWords | 関数 | The words with those named on a list left out. |
Word | 型 | One word as a lookup gives it. |
WordRow | 型 | A row read from a table. |
Words | 型 | Words that have been loaded, ready for a lookup that waits for nothing. |
WordsLoadError | クラス | What a lookup rejects with when a piece of the dictionary cannot be fetched, after one retry: a network that is down, a file the host does not serve, a bundler that left the piece out. |
WordsManifest | 型 | Where the pieces of the dictionary are. |
WordsMode | 型 | Which words a lookup gives: "safe" (the default) leaves out every sense JMdict marks vulgar, X-rated, sensitive or derogatory, and the written forms, readings and words that only such senses give; "unfiltered" is everything JMdict has. |
wordsOf | 関数 | The words for a text that has been loaded, the commonest first. |
WordsOptions | 型 | How words are looked up: the mode, and the consumer's own lists. |
WordsPiece | 型 | One piece of the table: rows by reading, or written forms with their readings, whichever file it came from. |
WordsPieceKind | 型 | Which set of pieces a WordsLoadError is about: readings and forms are the dictionary, extra-readings and extra-forms what safe mode leaves out, meanings and kanji the indexes (and their extra- kin), entries and examples the whole entries and the example sentences (and their extra- kin), common the table of common words, and manifest the small file that says where the pieces are. |
wordsWithKanji | 関数 | Words written with a kanji, the commonest first, each shown by the written form that holds the kanji. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。