mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-24 09:26:43 -06:00
remove nyaize
This commit is contained in:
parent
bebe631589
commit
4846ef606f
1 changed files with 13 additions and 13 deletions
|
@ -11,17 +11,17 @@ const koRegex2 = /(다$)|(다(?=\.))|(다(?= ))|(다(?=!))|(다(?=\?))/gm;
|
|||
const koRegex3 = /(야(?=\?))|(야$)|(야(?= ))/gm;
|
||||
|
||||
export function nyaize(text: string): string {
|
||||
return text
|
||||
// ja-JP
|
||||
.replaceAll('な', 'にゃ').replaceAll('ナ', 'ニャ').replaceAll('ナ', 'ニャ')
|
||||
// en-US
|
||||
.replace(enRegex1, x => x === 'A' ? 'YA' : 'ya')
|
||||
.replace(enRegex2, x => x === 'ING' ? 'YAN' : 'yan')
|
||||
.replace(enRegex3, x => x === 'ONE' ? 'NYAN' : 'nyan')
|
||||
// ko-KR
|
||||
.replace(koRegex1, match => String.fromCharCode(
|
||||
match.charCodeAt(0)! + '냐'.charCodeAt(0) - '나'.charCodeAt(0),
|
||||
))
|
||||
.replace(koRegex2, '다냥')
|
||||
.replace(koRegex3, '냥');
|
||||
return text;
|
||||
// // ja-JP
|
||||
// .replaceAll('な', 'にゃ').replaceAll('ナ', 'ニャ').replaceAll('ナ', 'ニャ')
|
||||
// // en-US
|
||||
// .replace(enRegex1, x => x === 'A' ? 'YA' : 'ya')
|
||||
// .replace(enRegex2, x => x === 'ING' ? 'YAN' : 'yan')
|
||||
// .replace(enRegex3, x => x === 'ONE' ? 'NYAN' : 'nyan')
|
||||
// // ko-KR
|
||||
// .replace(koRegex1, match => String.fromCharCode(
|
||||
// match.charCodeAt(0)! + '냐'.charCodeAt(0) - '나'.charCodeAt(0),
|
||||
// ))
|
||||
// .replace(koRegex2, '다냥')
|
||||
// .replace(koRegex3, '냥');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue