Reference · Example sentences of a word, with furigana and their credit
exampleCreditfunction
The credit an example carries, as a line to show with it: the Tatoeba sentence, the authors of the Japanese and of the English, and the licence.
Import it
import { exampleCredit } from "@johnmorrisdotca/jisho/examples";
Definition
function exampleCredit(example: Pick<Example, "credit">): string
Parameters
| Name | Type | Description |
|---|---|---|
example | Pick<Example, "credit"> | An example. |
Returns
string
A line such as "Tatoeba #162365, Japanese by alice, English by bob (CC BY 2.0 FR)".
Examples
import { exampleCredit, readExamples } from "@johnmorrisdotca/jisho/examples";
const [one] = readExamples("0000z\t1¦走る¦I run.¦¦3fk¦alice¦bob¦走る").examples;
console.log(one === undefined ? "" : exampleCredit(one)); // Tatoeba #4448, Japanese by alice, English by bob (CC BY 2.0 FR)Tatoeba #4448, Japanese by alice, English by bob (CC BY 2.0 FR)What it prints (run when this page was built)