foldKana関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Fold kana for a search: half-width katakana to full width, hiragana to katakana, and a small kana to its full-size
one. The long-vowel mark stays, and so does anything that is not kana, including letter case. fold applies this
and then its own rules, and the name lookups use fold, so a small kana and a full-size one find the same place.
インポート
import { foldKana } from "@johnmorrisdotca/kuni";
定義
function foldKana(text: string): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | What was typed, or a name to compare it with. |
戻り値
string
The text with its kana folded.
例
import { foldKana } from "@johnmorrisdotca/kuni";
console.log(foldKana("とうきょう")); // "トウキヨウ"
console.log(foldKana("はっぶる")); // "ハツブル"
console.log(foldKana("ラー")); // "ラー"トウキヨウ
ハツブル
ラー出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。