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

How-to

Type and mark kana

Keep unfinished romaji and distinguish size, voicing and family.

Incremental romaji

import {readRomaji,finishRomaji,kanaBase,markKanaGuess,kanaFound} from "@johnmorrisdotca/kotoba";
console.log(readRomaji("kan"),finishRomaji("kan"),kanaBase("ぱ"));
console.log(markKanaGuess(["ぱ","な"],["は","な"]));
console.log(kanaFound(["ぱ","な"],["は","な"]));
{ kana: [ 'か' ], rest: 'n' } [ 'か', 'ん' ] は
[
  { mark: 'hit', wrongSize: false, wrongMark: true },
  { mark: 'hit', wrongSize: false, wrongMark: false }
]
false

readRomaji returns completed kana and an unfinished suffix; keep rest for the next key. finishRomaji flushes input when submitting. In native state, erase removes pending romaji before completed kana. Size and voicing controls affect the last kana; they leave alphabet games unchanged.

Match enough to finish

Kana marks distinguish exact, elsewhere, same gojūon family and absent. A matching base in the correct place can still have a wrong-size or wrong-voicing arrow; it is not a completed answer until exact. The long-vowel bar has no family or size/voicing changes. Duplicate kana use remaining counts just like letters. kanaScore adds the same-family column component. See markKanaGuess and game rules.

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