The title string to normalize.
Normalized title (lowercase, no punctuation, single spaces).
export function normalizeForMatching(title: string): string {
// Try to get from cache first
const cacheWarmer = getCacheWarmer();
const cached = cacheWarmer.getNormalizedTitle(
title,
"normalizeForMatching",
normalizeForMatchingDirect,
);
if (cached) {
console.debug(
`[TitleNormalizer] ✅ Cache HIT for normalizeForMatching: "${title}" → "${cached}"`,
);
return cached;
}
// Cache miss - compute directly
const result = normalizeForMatchingDirect(title);
console.debug(
`[TitleNormalizer] ⚠️ Cache MISS for normalizeForMatching: "${title}" → "${result}"`,
);
return result;
}
Direct normalization for matching - checks cache first, then computes. Converts to lowercase, removes punctuation and special characters, normalizes whitespace.