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

readShiritoriWordsfunction

Reads the stored shiritori list into plain rows, commonest first.

Import it

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

Definition

function readShiritoriWords(packed: { readonly release: string; readonly rows: string; }): ShiritoriWord[]

Parameters

NameTypeDescription
packed{ readonly release: string; readonly rows: string; }

JA_SHIRITORI, from @johnmorrisdotca/kotoba/shiritori-ja: its rows hold one word a line, reading, word and meaning separated by tabs.

Returns

ShiritoriWord[]

Every word, commonest first.

Examples

import { readShiritoriWords, shiritoriChoices } from "@johnmorrisdotca/kotoba";
import { JA_SHIRITORI } from "@johnmorrisdotca/kotoba/shiritori-ja";

console.log(shiritoriChoices(readShiritoriWords(JA_SHIRITORI), ["さくら"])[0]);
{ reading: 'らいげつ', word: '来月', meaning: 'next month' }

What it prints (run when this page was built)

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