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

searchSayingsfunction

The proverbs or compounds that hold a piece of text in their written form, their reading or any of their meanings, ignoring case.

Import it

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

Definition

function searchSayings(sayings: readonly Saying[], text: string): Saying[]

Parameters

NameTypeDescription
sayingsreadonly Saying[]

The entries to search, from readSayings.

textstring

What was typed; blank text matches every entry.

Returns

Saying[]

The entries that match, in the order given.

Examples

import { readSayings, searchSayings } from "@johnmorrisdotca/kotoba";
import { JA_YOJIJUKUGO } from "@johnmorrisdotca/kotoba/yojijukugo-ja";

console.log(searchSayings(readSayings(JA_YOJIJUKUGO), "two birds")[0]?.saying);
一挙両得

What it prints (run when this page was built)

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