Files
unhomoglyph/addOther.js

45 lines
2.5 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const fs = require('fs')
const path = require('path')
const savePath = path.join(__dirname, 'data.json')
var data = require('./data.json')
const similarLetters = [
{ eng: "a", alts: "₳АаДдӔӕА̊а̊А̄а̄ӒӓӐӑꙘꙙѦѧӘәa͏α𝓐𝓪𝐀🇦𝐚" },
{ eng: "b", alts: "฿БбВвЫыЪъЬь6Ҍҍb͏𝓑𝓫𝐁𝐛🇧" },
{ eng: "c", alts: "🇨₵Сс(ҪҫС́с́c͏¢𝓒𝓬𝐂𝐜" },
{ eng: "d", alts: "ĐԂԃ🇩Ԁԁd͏𝓓𝓭𝐃𝐝" },
{ eng: "e", alts: ЕеЁёЗ🇪зЭэЄ̈є̈Е̃е̃Е̄е̄Ё̄ё̄ӖӗЀѐԐԑЄєӠӡe͏𝓔𝓮𝐄𝐞" },
{ eng: "f", alts: "₣Ғғf͏𝓕🇫𝓯𝐅𝐟" },
{ eng: "g", alts: "₲Ԍԍg͏𝓖𝓰𝐆🇬𝐠" },
{ eng: "h", alts: "НⱧнӉӊҢңԨԩӇӈҺһԊԋ🇭h͏𝓗𝓱𝐇𝐡" },
{ eng: "i", alts: "l1ł|ӀӏЇїІіi͏ι𝓘𝓲🇮𝐈𝐢" },
{ eng: "j", alts: "Јјj͏Jנ𝓙𝓳𝐉𝐣🇯" },
{ eng: "k", alts: "КкҚқ₭ҜҝҞҟҠҡk͏𝓚𝓴𝐊🇰𝐤" },
{ eng: "l", alts: "l͏𝓛𝓵𝐋𝐥🇱" },
{ eng: "m", alts: "МмӍӎm͏𝓜𝓶𝐌𝐦🇲" },
{ eng: "n", alts: "ИиЙйЛлП₦пԤԥn͏𝓝𝓷𝐍𝐧🇳" },
{ eng: "o", alts: "ОоЮюФф0ӪØӫӦӧО̄о̄ꙔꙕѲѳѺѻꙪꙫꙨꙩꚚꚛӨө🇴o͏σ𝓞𝓸𝐎𝐨" },
{ eng: "p", alts: "РрР̌р̌Ҏҏp͏ρ𝓟𝓹𝐏🇵" },
{ eng: "q", alts: "g9q͏𝓠𝓺𝐐Q𝐪🇶" },
{ eng: "r", alts: гЯяԘԙԆԇԄԅr͏𝓡𝓻𝐑𝐫Ɽ🇷" },
{ eng: "s", alts: "5Ѕѕs͏𝓢𝓼𝐒𝐬🇸₴" },
{ eng: "t", alts: "ТтҬҭt͏𝓣𝓽𝐓𝐭₮🇹" },
{ eng: "u", alts: "vЦцꙠꙡu͏υ𝓤𝓾𝐔𝐮🇺Ʉ"},
{ eng: "v", alts: "ѶѷѴѵv͏ν𝓥𝓿𝐕𝐯🇻"},
{ eng: "w", alts: "ШшЩщꚆꚇѠѡԜԝw͏ω𝓦𝔀𝐖𝐰🇼₩" },
{ eng: "x", alts: "ХхҲҳӾӿӼӽx͏χ𝓧𝔁𝐗🇽𝐱" },
{ eng: "y", alts: "УуҮүЧчЦцӮӯӰӱЎўӲӳꚎꚏy͏🇾𝓨𝔂𝐘𝐲Ɏ" },
{ eng: "z", alts: "2ЗзЖжЗ́ж́z͏𝓩𝔃𝐙𝐳Ⱬ🇿" }
]
similarLetters.forEach((letter) => {
const alts = letter.alts.normalize('NFD').replace(/\p{Diacritic}/gu, "").replace(/[\u200B-\u200D\uFEFF\u034F]/g, '');
[...alts].forEach((alt) => {
data[alt.toLowerCase()] = letter.eng
})
})
fs.writeFileSync(savePath, JSON.stringify(data, null, 2))
console.log("Added alternatives")