Last active
July 18, 2020 02:10
-
-
Save Canace22/9ab07f70e39c84d6fd50de54956ba032 to your computer and use it in GitHub Desktop.
createKanji
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
function createKanji() { | |
const arr = []; | |
for (let i = 0x4e00; i < 0x9faf; i++) { | |
arr.push(String.fromCharCode(i)); | |
} | |
const sortedChars = arr.sort(Intl.Collator('ja-JP').compare); | |
const level1Kanji = sortedChars.slice(0, 2965); | |
const level2Kanji = sortedChars.slice(2965, 6355); | |
fs.writeFileSync('./output.txt', level1Kanji + level2Kanji); | |
} | |
createKanji(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment