Skip to the content

Kotoba言葉

Load only the word lists you need, mark repeated letters correctly and play a daily or seeded word game.

Kotoba is the Japanese word for words. About the name

Contents

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

NameTypeDescription
typedstring

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kotoba 1.2.0.