Reference · Marking, scores and game rules
readRomajifunction
What has been typed, as kana, and what is still being typed.
Import it
import { readRomaji } from "@johnmorrisdotca/kotoba";
Definition
function readRomaji(typed: string): { kana: string[]; rest: string; }
Parameters
| Name | Type | Description |
|---|---|---|
typed | string | Romaji text to consume into kana and any unfinished suffix. |
Returns
{ kana: string[]; rest: string; }
What has been typed, as kana, and what is still being typed.
Examples
import { readRomaji } from "@johnmorrisdotca/kotoba";
console.log(readRomaji("konnichiha"));{ kana: [ 'こ', 'ん', 'に', 'ち', 'は' ], rest: '' }What it prints (run when this page was built)