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

shiritoriHeadKeyfunction

The kana a reading starts on, or null when it holds none.

Import it

import { shiritoriHeadKey } from "@johnmorrisdotca/kotoba";

Definition

function shiritoriHeadKey(reading: string, rules?: ShiritoriRules): string | null

Parameters

NameTypeDescription
readingstring

The reading of a word.

rules (optional)ShiritoriRules

House rules; the forgiving ones if left out.

Returns

string | null

The key to compare against the last word's tail, or null.

Examples

import { shiritoriHeadKey } from "@johnmorrisdotca/kotoba";

console.log(shiritoriHeadKey("がっこう"), shiritoriHeadKey("がっこう", { voicing: "kept" })); // か が
か が

What it prints (run when this page was built)

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