fix
This commit is contained in:
parent
78d1e9eabd
commit
2f1a4a5e67
|
@ -8,9 +8,9 @@ export function nyaize(text: string): string {
|
||||||
// ja-JP
|
// ja-JP
|
||||||
.replaceAll('な', 'にゃ').replaceAll('ナ', 'ニャ').replaceAll('ナ', 'ニャ')
|
.replaceAll('な', 'にゃ').replaceAll('ナ', 'ニャ').replaceAll('ナ', 'ニャ')
|
||||||
// en-US
|
// en-US
|
||||||
.replace(/(na|NA)(?=[^a-z])/g, (match) => match === 'NA' ? 'NYA' : 'nya')
|
.replace(/na/gi, (match) => match === 'NA' ? 'NYA' : 'nya')
|
||||||
.replace(/(morn)(ing)(?=[^a-z])/gi, (match, p1, p2) => p2 === 'ING' ? `${p1}YAN` : `${p1.toLowerCase()}yan`)
|
.replace(/morning/gi, (match) => match === 'MORNING' ? 'MORNYAN' : 'mornyan')
|
||||||
.replace(/(every)(one)(?=[^a-z])/gi, (match, p1, p2) => p2 === 'ONE' ? `${p1}NYAN` : `${p1.toLowerCase()}nyan`)
|
.replace(/everyone/gi, (match) => match === 'EVERYONE' ? 'EVERYNYAN' : 'everynyan')
|
||||||
// ko-KR
|
// ko-KR
|
||||||
.replace(/[나-낳]/g, match => String.fromCharCode(
|
.replace(/[나-낳]/g, match => String.fromCharCode(
|
||||||
match.charCodeAt(0)! + '냐'.charCodeAt(0) - '나'.charCodeAt(0),
|
match.charCodeAt(0)! + '냐'.charCodeAt(0) - '나'.charCodeAt(0),
|
||||||
|
|
Loading…
Reference in New Issue