feat: add 수고, 레전드

This commit is contained in:
kimpure 2026-07-19 08:23:56 +00:00
parent f1d070702a
commit 409a5cff24
No known key found for this signature in database
2 changed files with 16 additions and 7 deletions

View file

@ -15,7 +15,7 @@ export abstract class TTSModelBase<RequestId> {
public ttsify(input: string): string { public ttsify(input: string): string {
return saferKorean( return saferKorean(
input.replace( input.replace(
/:[^:]+:/g, /:[a-zA-Z0-9_]+:/g,
(text: string): string => TTSModelBase.EMOJI_MAP[text] ?? "이모지", (text: string): string => TTSModelBase.EMOJI_MAP[text] ?? "이모지",
), ),
); );

View file

@ -9,6 +9,9 @@ export function processUnsounds(input: string): string {
return ( return (
input input
// Change tailing dots // Change tailing dots
.replace(/^ *([.,]+) *$/, (_, content: string) =>
"쩜".repeat(Math.max(content.length, 3)),
)
.replace(/[.,]+$/, "") .replace(/[.,]+$/, "")
.replace(/[.,]{2,}/g, "") .replace(/[.,]{2,}/g, "")
.replace(/[.,]\s/g, " ") .replace(/[.,]\s/g, " ")
@ -36,12 +39,12 @@ export function processCensor(input: string): string {
/([\S!?~]+)([!?~]*)/g, /([\S!?~]+)([!?~]*)/g,
(_, content: string, tailSymbol: string) => content + tailSymbol, (_, content: string, tailSymbol: string) => content + tailSymbol,
) )
.replace( .replace(/([흐하해헤혀형][아으앙응앗웅응ㅡ !?.,><~'"/]+)/g, "")
/([흐하해헤혀형][아으앙응앗웅응ㅡ!?.,><~'"/]+)/g,
(content: string) => content[0] ?? "",
)
.replace(processCensor.StrangeRepeatableRegex, (content: string) => .replace(processCensor.StrangeRepeatableRegex, (content: string) =>
content.substring(0, 3), content.substring(0, 3),
)
.replace(processCensor.StrangeJoinerRegex, (content: string) =>
content.substring(0, 2),
); );
} }
export namespace processCensor { export namespace processCensor {
@ -51,14 +54,18 @@ export namespace processCensor {
"에", "오", "ㅗ", "야", "ㅑ", "읍", "앙", "읏", "에", "오", "ㅗ", "야", "ㅑ", "읍", "앙", "읏",
"웃", "엉", "앗", "엣", "웅", "응", "흐", "해", "웃", "엉", "앗", "엣", "웅", "응", "흐", "해",
"헤", "헼", "헥", "하", "형", "혀", "흡", "흑", "헤", "헼", "헥", "하", "형", "혀", "흡", "흑",
"협", "혓", "핫", "헵", "햅", "잇", "협", "혓", "핫", "헵", "햅", "잇", "ㅇ",
"あ", "ア", "う", "お", "ー", "あ", "ア", "う", "お", "ー",
"a", "A", "o", "O", "u", "U", "a", "A", "o", "O", "u", "U",
]; ];
export const StrangeRepeatableRegex = new RegExp( export const StrangeRepeatableRegex = new RegExp(
`[${StrangeRepeatable.join("")}][${StrangeRepeatable.join("")}!.,><~'"/]{2,}`, `[${StrangeRepeatable.join("")}][${StrangeRepeatable.join("")} !.,><~'"/]{2,}`,
"g", "g",
); );
export const StrangeJoiner = ["아", "으", "앙"];
export const StrangeJoinerRegex = new RegExp(
`[${StrangeJoiner.join("")}]{2,}`,
);
} }
// 핵토파스칼, 바, 핵타르 AU (에이커 인치 피트 야드) // 핵토파스칼, 바, 핵타르 AU (에이커 인치 피트 야드)
@ -104,6 +111,7 @@ export namespace processKorean {
: "이쁜사랑", : "이쁜사랑",
: "이지랄", : "이지랄",
: "지랄노", : "지랄노",
: "래전드",
: "모야", : "모야",
: "하이", : "하이",
: "싫어", : "싫어",
@ -131,6 +139,7 @@ export namespace processKorean {
: "잠깐만", : "잠깐만",
: "존나", : "존나",
: "가능", : "가능",
: "수고",
}; };
export const DoubleMixedChoseongMapRegex = new RegExp( export const DoubleMixedChoseongMapRegex = new RegExp(
Object.keys(DoubleMixedChoseongMap) Object.keys(DoubleMixedChoseongMap)