From c49321ccf1ca8cb1dcc8e479d600534e5d78a072 Mon Sep 17 00:00:00 2001 From: Samu Date: Sat, 29 Aug 2026 16:54:59 +0200 Subject: [PATCH] feat: match ae/oe ligatures in normalization --- server/src/matcher.ts | 2 ++ server/test/matcher.test.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/server/src/matcher.ts b/server/src/matcher.ts index a0beb14..ef902e2 100644 --- a/server/src/matcher.ts +++ b/server/src/matcher.ts @@ -11,6 +11,8 @@ export interface Matchable { export function normalize(input: string): string { return input .toLowerCase() + .replace(/æ/g, 'ae') + .replace(/œ/g, 'oe') .normalize('NFKD') .replace(/[\u0300-\u036f]/g, '') .replace(/[^\p{L}\p{N}\s]/gu, ' ') diff --git a/server/test/matcher.test.ts b/server/test/matcher.test.ts index ef51db7..b6023d4 100644 --- a/server/test/matcher.test.ts +++ b/server/test/matcher.test.ts @@ -7,6 +7,7 @@ describe('normalize', () => { expect(normalize(' Blur: The Best of… ')).toBe('blur best of') expect(normalize('Björk — Début')).toBe('bjork debut') expect(normalize('A Tribe Called Quest')).toBe('tribe called quest') + expect(normalize('Ænima')).toBe('aenima') }) })