Reference · Look words up by reading, written form, English meaning, kanji or romaji
ReadResulttype
What readText gives.
Import it
import type { ReadResult } from "@johnmorrisdotca/jisho/words";
Definition
type ReadResult = {
readonly text: string;
readonly tokens: readonly ReadToken[];
readonly unknown: readonly string[];
readonly release: string;
readonly truncated: boolean;
};
Members
| Name | Type | Description |
|---|---|---|
text | string | The text that was read: made plain (NFKC, invisible characters removed) and cut at |
tokens | readonly ReadToken[] | The pieces, in order, which put together are |
unknown | readonly string[] | The stretches of Japanese that no word was found for, once each, in the order they came. |
release | string | The JMdict release the words are from. |
truncated | boolean | Whether the text was longer than |
Examples
import type { ReadResult } from "@johnmorrisdotca/jisho/words";
const count = (result: ReadResult) => result.tokens.length;
console.log(typeof count);functionWhat it prints (run when this page was built)