diff options
Diffstat (limited to 'src/common-util')
| -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; } |