Add full width number mapping

This commit is contained in:
kimpure 2026-05-22 15:00:11 +00:00
parent cca2769b07
commit f49d16f8e2
No known key found for this signature in database
2 changed files with 21 additions and 1 deletions

View file

@ -211,6 +211,7 @@
"👅": "혀",
"👄": "입",
"🫦": "입술을 깨물다",
"🧛‍♂️": "뱀파이어",
"👶": "아기",
"🧒": "어린이",
"👦": "소년",
@ -1265,7 +1266,7 @@
"⚜": "플뢰르 드 리",
"🔱": "삼지창 엠블럼",
"📛": "이름배지",
"🔰": "초급을 뜻하는 일본어 기호",
"🔰": "초급 기호",
"⭕": "속이 빈 붉은 원",
"✅": "체크 표시 버튼",
"☑": "체크박스가 있는 체크박스",

View file

@ -57,6 +57,7 @@ export function processKorean(input: string): string {
}
export namespace processKorean {
export const DoubleMixedChoseongMap = {
: "이쁜사랑",
: "이지랄",
: "지랄노",
: "하이",
@ -519,9 +520,27 @@ export namespace processIsolatedSymbol {
};
}
export function processFullWidth(input: string): string {
return input.replace(
/[]/g,
(i) =>
processFullWidth.FullWidthNumberMap[
i as keyof typeof processFullWidth.FullWidthNumberMap
],
);
}
export namespace processFullWidth {
// prettier-ignore
export const FullWidthNumberMap = {
"": "0", "": "1", "": "2", "": "3", "": "4",
"": "5", "": "6", "": "7", "": "8", "": "9",
};
}
export function saferKorean(input: string): string {
return (input.normalize() + " ")
.let((i) => processUnsounds(i))
.let((i) => processFullWidth(i))
.let((i) => processIsolatedSymbol(i))
.let((i) => processMarkdown(i))
.let((i) => processKorean(i))