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

readWordListsfunction

One length of a list read into words, or null for a length the list does not have.

Import it

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

Definition

function readWordLists(data: WordData, size: number): WordLists | null

Parameters

NameTypeDescription
dataWordData

The packed dictionary groups keyed by word length.

sizenumber

The number of letters or kana in each word.

Returns

WordLists | null

One length of a list read into words, or null for a length the list does not have.

Examples

import { readWordLists } from "@johnmorrisdotca/kotoba";
import { EN_WORDS } from "@johnmorrisdotca/kotoba/words-en";

console.log(readWordLists(EN_WORDS,5)?.answers.length);
2036

What it prints (run when this page was built)

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