Skip to content

Instantly share code, notes, and snippets.

@ddikman
Created March 17, 2022 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddikman/94ba4dd9eedf177b159b9b67750fe2bc to your computer and use it in GitHub Desktop.
Save ddikman/94ba4dd9eedf177b159b9b67750fe2bc to your computer and use it in GitHub Desktop.
Generate all hiragana
let hiragana = [...Array(0x3095 - 0x3041).keys()].map((i) => String.fromCharCode(0x3041 + i))
/*
Generates 84 hiragana based on
https://sites.psu.edu/symbolcodes/languages/asia/japanese/hiraganachart/
[
'ぁ', 'あ', 'ぃ', 'い', 'ぅ', 'う', 'ぇ', 'え',
'ぉ', 'お', 'か', 'が', 'き', 'ぎ', 'く', 'ぐ',
'け', 'げ', 'こ', 'ご', 'さ', 'ざ', 'し', 'じ',
'す', 'ず', 'せ', 'ぜ', 'そ', 'ぞ', 'た', 'だ',
'ち', 'ぢ', 'っ', 'つ', 'づ', 'て', 'で', 'と',
'ど', 'な', 'に', 'ぬ', 'ね', 'の', 'は', 'ば',
'ぱ', 'ひ', 'び', 'ぴ', 'ふ', 'ぶ', 'ぷ', 'へ',
'べ', 'ぺ', 'ほ', 'ぼ', 'ぽ', 'ま', 'み', 'む',
'め', 'も', 'ゃ', 'や', 'ゅ', 'ゆ', 'ょ', 'よ',
'ら', 'り', 'る', 'れ', 'ろ', 'ゎ', 'わ', 'ゐ',
'ゑ', 'を', 'ん', 'ゔ'
]
Worth noting is that we also usually use the hyphen 「ー」and rarely use either「ゐ」or 「ゑ」
the same could be said for a fair number of the small version え、あ、い、う、お and definitely わ
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment