Api
Dictionary + tokenizer API helpers.
Functions¶
apiDictQuery()¶
Defined in: src/shared/dict/api.ts:51
Looks up dictionary data for a word or wildcard pattern.
Parameters¶
| Parameter | Type | Default value | Description |
|---|---|---|---|
word |
string |
undefined |
The word or wildcard pattern. |
wildcard? |
boolean |
false |
Treat word as a wildcard pattern. |
Returns¶
The lookup result.
apiTokenize()¶
Defined in: src/shared/dict/api.ts:16
Tokenizes a sentence on the server, returning one stitched JapaneseWord per
word (no dictionary data).
Parameters¶
| Parameter | Type | Default value | Description |
|---|---|---|---|
sentence |
string |
undefined |
The Japanese sentence. |
mode? |
BundleMode |
"grammar" |
How aggressively to group tokens. |
Returns¶
Promise\<JapaneseWord[]>
The stitched words.
apiTokenizeBatch()¶
Defined in: src/shared/dict/api.ts:34
Tokenizes many sentences in one request (used to pre-tokenize a whole subtitle file).
Parameters¶
| Parameter | Type | Default value | Description |
|---|---|---|---|
sentences |
string[] |
undefined |
The sentences, in order. |
mode? |
BundleMode |
"grammar" |
How aggressively to group tokens. |
Returns¶
Promise\<JapaneseWord[][]>
One word list per input sentence.
isEmptyDict()¶
Defined in: src/shared/dict/api.ts:62
Whether a dictionary lookup found nothing (every result list empty).
Parameters¶
| Parameter | Type | Description |
|---|---|---|
data |
KotobaseData |
The lookup result. |
Returns¶
boolean
true when empty.