Reference · Sentence difficulty
kanjiInfunction
Every kanji in the text, once each, in the order they appear. Kana, punctuation and 々 are not kanji.
Import it
import { kanjiIn } from "@johnmorrisdotca/hikidashi/difficulty";
Also exported from: @johnmorrisdotca/hikidashi
Definition
function kanjiIn(text: string): string[]
Parameters
| Name | Type | Description |
|---|---|---|
text | string | Any text. |
Returns
string[]
The distinct kanji (CJK Unified Ideographs and Extension A), first appearance first; an empty list when there are none.
Examples
import { kanjiIn } from "@johnmorrisdotca/hikidashi/difficulty";
console.log(kanjiIn("毎日、日本語を勉強する。"), kanjiIn("ひらがな"));[ '毎', '日', '本', '語', '勉', '強' ] []What it prints (run when this page was built)