From d850381376e789aeb7e64a2d9c1361396ad78581 Mon Sep 17 00:00:00 2001 From: sinofp Date: Sun, 9 Jul 2023 18:54:12 +0100 Subject: [PATCH] Implement speak-as-cat for Chinese and Greek MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Chinese meow character is 喵, whose pinyin is miāo. 妙, 庙, 描, 渺, 瞄, 秒, 苗, and 藐 are all the miao characters from *3500 commonly used Chinese characters.xls* @naskya proposed to include 廟 and να. Download the spreadsheet from https://faculty.blcu.edu.cn/xinghb/zh_CN/article/167473/content/1045.htm See the discussion at https://codeberg.org/calckey/calckey/issues/9746#issuecomment-974699 --- packages/backend/src/misc/nyaize.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/backend/src/misc/nyaize.ts b/packages/backend/src/misc/nyaize.ts index dd0c5bbdff..2b996c611e 100644 --- a/packages/backend/src/misc/nyaize.ts +++ b/packages/backend/src/misc/nyaize.ts @@ -20,5 +20,9 @@ export function nyaize(text: string): string { ) .replace(/(다$)|(다(?=\.))|(다(?= ))|(다(?=!))|(다(?=\?))/gm, "다냥") .replace(/(야(?=\?))|(야$)|(야(?= ))/gm, "냥") + // Chinese + .replace(/(妙|庙|描|渺|瞄|秒|苗|藐|廟)/g, "喵") + // Greek + .replaceAll("να", "νια") ); }