Skip to content

Instantly share code, notes, and snippets.

@Canace22
Last active July 18, 2020 02:10
Show Gist options
  • Save Canace22/9ab07f70e39c84d6fd50de54956ba032 to your computer and use it in GitHub Desktop.
Save Canace22/9ab07f70e39c84d6fd50de54956ba032 to your computer and use it in GitHub Desktop.
createKanji
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