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 {
return saferKorean(
input.replace(
/:[^:]+:/g,
/:[a-zA-Z0-9_]+:/g,
(text: string): string => TTSModelBase.EMOJI_MAP[text] ?? "이모지",
),
);

View file

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