feat: add 수고, 레전드
This commit is contained in:
parent
f1d070702a
commit
409a5cff24
2 changed files with 16 additions and 7 deletions
|
|
@ -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] ?? "이모지",
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue