From df3273f80a0fb0cac2a9a6de7a4bb8ca36555d33 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Wed, 10 Apr 2024 17:34:26 +0200 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D0=B8=D0=BC=D0=B2=D0=BE=D0=BB=D0=B0=20=E2=B1=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/engine.test.ts | 4 ++++ src/unicode.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/engine.test.ts b/src/engine.test.ts index 81bd0b1..6a06955 100644 --- a/src/engine.test.ts +++ b/src/engine.test.ts @@ -80,6 +80,10 @@ describe('getResponse', () => { it('should handle pictographic before text', () => expect(getResponse('♡ Да')).toBe('♡ Пизда')); }); + describe('just random cases reported by users', () => { + it('ДⱯ!', () => expect(getResponse('ДⱯ!')).toBe('ПИЗДⱯ?')); + }); + describe('should be forgiven if the answer is more detailed', () => { it('case 1', () => expect(getResponse('да, мы милосердны')).toBeUndefined()); it('case 2', () => expect(getResponse('мы милосердны, да')).toBeUndefined()); diff --git a/src/unicode.ts b/src/unicode.ts index 1007a08..a2bb4b3 100644 --- a/src/unicode.ts +++ b/src/unicode.ts @@ -5,7 +5,7 @@ const normalizationMap = new Map(); const normalizationDictionary: Record = { 'D': '🄓Ꭰ🄳𝔡𝖉𝔻𝗗𝘋𝙳𝐷𝓓𝐃𝑫𝕯𝖣𝔇𝘿ꭰⅅ𝒟ꓓ🅳🅓ⒹDƉᗪƊÐԺᴅᴰↁḊĐÞⅮᗞᑯĎḌḐḒḎᗫᗬᗟᗠᶛᴆ🇩', 'd': 'Ꮷ𝔡𝖉ᑯꓒ𝓭ᵭ₫ԃⓓdḋďḍḑḓḏđƌɖɗᵈ⒟ԁⅾᶁԀᑺᑻᑼᑽᒄᑰᑱᶑ𝕕𝖽𝑑𝘥𝒅𝙙𝐝𝗱𝚍ⅆ𝒹ʠժ', - 'A': '𝑨𝔄ᗄ𝖠𝗔ꓯ𝞐🄐🄰Ꭿ𐊠𝕬𝜜𝐴ꓮᎪ𝚨ꭺ𝝖🅐Å∀🇦₳🅰𝒜𝘈𝐀𝔸ǺᗅⒶAΑᾋᗩĂÃÅǍȀȂĀȺĄʌΛλƛᴀᴬልÄₐᕱǞӒΆẠẢẦẨẬẮẰẲẴẶᾸᾹᾺΆᾼᾈᾉᾊᾌᾍᾎᾏἈἉἊἋἌἍἎἏḀȦǠӐÀÁÂẤẪ𝛢𝓐𝙰𝘼ᗩ', + 'A': '𝑨𝔄ᗄ𝖠𝗔ꓯ𝞐🄐🄰Ꭿ𐊠𝕬𝜜𝐴ꓮᎪ𝚨ꭺ𝝖🅐Å∀Ɐ🇦₳🅰𝒜𝘈𝐀𝔸ǺᗅⒶAΑᾋᗩĂÃÅǍȀȂĀȺĄʌΛλƛᴀᴬልÄₐᕱǞӒΆẠẢẦẨẬẮẰẲẴẶᾸᾹᾺΆᾼᾈᾉᾊᾌᾍᾎᾏἈἉἊἋἌἍἎἏḀȦǠӐÀÁÂẤẪ𝛢𝓐𝙰𝘼ᗩ', 'a': '∂⍺@ⓐձǟªᵃᶏ⒜ɒaαȃȁคǎმäɑāɐąᾄẚạảǡầẵḁȧӑӓãåάὰάăẩằẳặᾀᾁᾂᾃᾅᾆᾰᾱᾲᾳᾴᶐᾶᾷἀἁἂἃἄἅἆἇᾇậắàáâấẫǻⱥ𝐚𝑎𝒂𝒶𝓪𝔞𝕒𝖆𝖺𝗮𝘢𝙖𝚊𝛂𝛼𝜶𝝰𝞪⍶æ', }; for (const normalLetter in normalizationDictionary) {