1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-05 10:18:38 +09:00

korean nyaize

This commit is contained in:
syuilo 2020-02-05 21:11:24 +09:00
parent 3c4bae763f
commit ddd7b04646

View File

@ -7,5 +7,7 @@ export function nyaize(text: string): string {
// ko-KR
.replace(/[나-낳]/g, match => String.fromCharCode(
match.codePointAt(0)! + '냐'.charCodeAt(0) - '나'.charCodeAt(0)
));
))
.replace(/(다$)|(다(?=\.))|(다(?= ))|(다(?=!))|(다(?=\?))/gm, '다냥')
.replace(/(야(?=\?))|(야$)|(야(?= ))/gm, '냥');
}