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
| Name | Type | Description |
|---|---|---|
reading | string | 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)