add 우우, 유유, 응응, 아니, 리얼 process
This commit is contained in:
parent
8f4b3fe0fd
commit
02b8a27c28
1 changed files with 25 additions and 7 deletions
|
|
@ -217,22 +217,32 @@ export function saferKorean(input: string): string {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Process koreans
|
// Process koreans
|
||||||
.replace(/ㅋ{2,}/g, (content) => "크".repeat(content.length))
|
|
||||||
.replace(/[아ㅏ]{3,}/g, "아아아")
|
.replace(/[아ㅏ]{3,}/g, "아아아")
|
||||||
.replace(/ㅌ{2,}/g, "틔틔")
|
.replace(/ㄹㅇ/g, (content: string) => {
|
||||||
.replace(/ㄷ{2,}/g, "덜덜")
|
return "리얼".repeat(
|
||||||
.replace(/ㄴ{2,}/g, "노노")
|
Math.min(Math.floor(content.length / 2), 2)
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.replace(/(ㅇㄴ)+/g, (content: string) => {
|
||||||
|
return "아니".repeat(
|
||||||
|
Math.min(Math.floor(content.length / 2), 2)
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.replace(/(ㅇㅎ)+/g, (content: string) => {
|
||||||
|
return "아하".repeat(
|
||||||
|
Math.min(Math.floor(content.length / 2), 2)
|
||||||
|
);
|
||||||
|
})
|
||||||
.replace(/(ㅇㅋ)+/g, (content: string) => {
|
.replace(/(ㅇㅋ)+/g, (content: string) => {
|
||||||
return "오키".repeat(
|
return "오키".repeat(
|
||||||
Math.min(Math.floor(content.length / 2), 4)
|
Math.min(Math.floor(content.length / 2), 2)
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.replace(/(ㅊㅋ)+/g, (content: string) => {
|
.replace(/(ㅊㅋ)+/g, (content: string) => {
|
||||||
return "추카".repeat(
|
return "추카".repeat(
|
||||||
Math.min(Math.floor(content.length / 2), 4)
|
Math.min(Math.floor(content.length / 2), 2)
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.replace(/ㅊ{2,}/g, "추추")
|
|
||||||
.replace(/ㄱ+/g, (content: string) => {
|
.replace(/ㄱ+/g, (content: string) => {
|
||||||
if (content.length == 2) {
|
if (content.length == 2) {
|
||||||
return "고고";
|
return "고고";
|
||||||
|
|
@ -241,6 +251,14 @@ export function saferKorean(input: string): string {
|
||||||
}
|
}
|
||||||
return content;
|
return content;
|
||||||
})
|
})
|
||||||
|
.replace(/ㅋ{2,}/g, (content) => "크".repeat(content.length))
|
||||||
|
.replace(/ㅌ{2,}/g, "틔틔")
|
||||||
|
.replace(/ㄷ{2,}/g, "덜덜")
|
||||||
|
.replace(/ㄴ{2,}/g, "노노")
|
||||||
|
.replace(/ㅇ{2,}/g, "응응")
|
||||||
|
.replace(/ㅊ{2,}/g, "추추")
|
||||||
|
.replace(/ㅠ{2,}/g, "유유")
|
||||||
|
.replace(/ㅜ{2,}/g, "우우")
|
||||||
.replace(/[ㄱ-ㅎㄲㄸㅃㅆㅉ]/g, (char: string) => ChoseongMap[char as keyof typeof ChoseongMap])
|
.replace(/[ㄱ-ㅎㄲㄸㅃㅆㅉ]/g, (char: string) => ChoseongMap[char as keyof typeof ChoseongMap])
|
||||||
|
|
||||||
// Process number, unit
|
// Process number, unit
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue