Passages
One call for a whole passage: a row for each word, with what the dictionary holds about it.
The call
POST /v1/annotate takes a passage as passage in a JSON body, in Japanese, English or both, and answers a row for each word in the order the passage writes them. The script of a word decides its language, so the request names none. Punctuation and symbols have no row. The reference gives the longest passage one call takes.
A row
A word is the longest run the dictionary holds as one written form, so 見に行きました is one row with its form named, not five. Every row carries the same fields, and what a word does not have is null.
| Field | What it holds |
|---|---|
surface | The word as the passage writes it. |
start, end | Where it starts and ends in the passage, counted in Unicode code points from 0. The end is exclusive. |
lang | jpn or eng. |
headword | The base form: the headword of the word's entry, which the entry route answers in full. Null for a word with no entry, a name for example. |
reading | Japanese only. The reading chosen for the word, in kana. |
other_readings | Japanese only. Every other reading the written form has. |
form | The inflected form the word is written in: its name with translations and, on a Japanese word, whether it is positive or negative and plain or polite. Null for a word in its base form. |
accent | Japanese only. The headword's pitch accent, the number the entry gives. |
frequency_band | How common the word is, one of the five bands. Null for a word with no entry and for an entry the dictionary has not ranked. |
pos | The word class, named in the word's language. |
gloss | The entry's first gloss, in the other language. |
The reading, the accent and the gloss
reading is the reading chosen for the word: a written form can have several, and other_readings lists the rest, so a client can show the one chosen and offer the others. accent is the headword's: an inflected form carries its headword's accent and none of its own. gloss is the entry's first: it is not the sense the passage uses, and the entry has every sense.
What it costs
A passage costs $4 for 1,000,000 characters, drawn from the same balance as a lookup. Every character you send counts, spaces and punctuation included, so the passage above, 18 characters, draws $0.000072. A refused request draws nothing.
The passage you send is not stored.
Credit
immit uses UniDic-cwj 3.1.1, by The UniDic Consortium and Teruaki Oka, under the BSD License, in the compact build that is Copyright (c) 2023, LegalOn Technologies, Inc.