diff --git a/ext/js/language/zh/chinese.js b/ext/js/language/zh/chinese.js index c024cad3bd..a824cb7f51 100644 --- a/ext/js/language/zh/chinese.js +++ b/ext/js/language/zh/chinese.js @@ -71,5 +71,5 @@ export function isCodePointChinese(codePoint) { /** @type {import('language').ReadingNormalizer} */ export function normalizePinyin(str) { - return str.normalize('NFC').toLowerCase().replace(/[\s・:]|\/\//g, ''); + return str.normalize('NFC').toLowerCase().replace(/[\s・:'’-]|\/\//g, ''); } diff --git a/test/language/chinese-reading-normalizer.test.js b/test/language/chinese-reading-normalizer.test.js index 151f58c194..ad6f9a88c4 100644 --- a/test/language/chinese-reading-normalizer.test.js +++ b/test/language/chinese-reading-normalizer.test.js @@ -25,6 +25,9 @@ const tests = [ ['wán:zhěng', 'wánzhěng'], ['fān・yì', 'fānyì'], ['fān//yì', 'fānyì'], + ['fān’yì', 'fānyì'], + ['fān\'yì', 'fānyì'], + ['fān-yì', 'fānyì'], ]; describe('Normalize Pinyin', () => {