Skip to content

Commit

Permalink
update normalizer regex (#1215)
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Vuković <[email protected]>
  • Loading branch information
Casheeew and StefanVukovic99 authored Jul 13, 2024
1 parent 3823c82 commit 165ed8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/js/language/zh/chinese.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ export function isStringPartiallyChinese(str) {

/** @type {import('language').ReadingNormalizer} */
export function normalizePinyin(str) {
return str.normalize('NFC').toLowerCase().replace(/[\s・:]/g, '');
return str.normalize('NFC').toLowerCase().replace(/[\s・:]|\/\//g, '');
}
1 change: 1 addition & 0 deletions test/language/chinese-reading-normalizer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const tests = [
['Wéi jī Bǎi kē', 'wéijībǎikē'],
['wán:zhěng', 'wánzhěng'],
['fān・yì', 'fānyì'],
['fān//yì', 'fānyì'],
];

describe('Normalize Pinyin', () => {
Expand Down

0 comments on commit 165ed8d

Please sign in to comment.