diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-01-10 16:14:25 -0400 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-01-10 16:14:38 -0400 |
| commit | c7916fd1c6206e666655c24595c9610f577e2071 (patch) | |
| tree | f4ef509f20abd98b5f801eaf8fe7bb05ab051d69 /src/common-util/sort.js | |
| parent | 5c3317f02e32291f20d6f1257e290dcec6bbba06 (diff) | |
sort: le la l'
Diffstat (limited to 'src/common-util/sort.js')
| -rw-r--r-- | src/common-util/sort.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/common-util/sort.js b/src/common-util/sort.js index bbe4e551..b87ef500 100644 --- a/src/common-util/sort.js +++ b/src/common-util/sort.js @@ -45,11 +45,14 @@ export function normalizeName(s) { ) .trim(); - // Discard anything that isn't a letter, number, or space. - s = s.replace(/[^\p{Letter}\p{Number} ]/gu, '').trim(); + // Discard anything that isn't a letter, number, space, or apostrophe. + s = s.replace(/[^\p{Letter}\p{Number} ']/gu, '').trim(); - // Remove common English (only, for now) prefixes. - s = s.replace(/^(?:an?|the) /i, ''); + // Remove common articles. + s = s.replace(/^(?:an?|the|le|la|l') /i, ''); + + // Discard apostrophes. + s = s.replace(/'/g, '').trim(); return s; } |