Reference · Look words up by reading, written form, English meaning, kanji or romaji
furiganaOfSurfacefunction
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 べなかった. Conjugation changes the end of a word, so the pieces of the dictionary form hold as far as the two spellings agree, and what follows is kana that needs no reading. 来 takes the reading its ending asks for.
Import it
import { furiganaOfSurface } from "@johnmorrisdotca/jisho/words";
Definition
function furiganaOfSurface(surface: string, base: string, reading: string): FuriganaPart[]
Parameters
| Name | Type | Description |
|---|---|---|
surface | string | The word as the text writes it. |
base | string | The dictionary form it comes from, as spelled when it was looked up (the surface itself for a word that is not conjugated). |
reading | string | The reading of the dictionary form. |
Returns
FuriganaPart[]
The pieces, which put together are surface.
Examples
import { furiganaOfSurface } from "@johnmorrisdotca/jisho/words";
console.log(furiganaOfSurface("食べなかった", "食べる", "たべる")); // [{ text: "食", reading: "た" }, { text: "べなかった" }][ { text: '食', reading: 'た' }, { text: 'べ' }, { text: 'なかった' } ]What it prints (run when this page was built)