diff --git a/src/lib/pages/SettingsPage.svelte b/src/lib/pages/SettingsPage.svelte index a78d137..1019fcf 100644 --- a/src/lib/pages/SettingsPage.svelte +++ b/src/lib/pages/SettingsPage.svelte @@ -196,15 +196,19 @@ async function addBulkVocabTerms() { const raw = bulkVocabText; // Accept newline-separated OR comma-separated (or mixed) — whichever the - // user pasted. Trim each entry, drop empties, dedupe within the input. - const candidates = Array.from( - new Set( - raw - .split(/[\n,]+/) - .map((entry) => entry.trim()) - .filter((entry) => entry.length > 0), - ), - ); + // user pasted. Trim each entry, drop empties, and dedupe case-insensitively + // so "ACME" and "acme" in the same paste collapse to a single term + // (Whisper prompts don't care about case). + const seen = new Set(); + const candidates = []; + for (const entry of raw.split(/[\n,]+/)) { + const trimmed = entry.trim(); + if (!trimmed) continue; + const key = trimmed.toLowerCase(); + if (seen.has(key)) continue; + seen.add(key); + candidates.push(trimmed); + } if (candidates.length === 0) { vocabularyError = "Nothing to import — paste one term per line or separated by commas."; return;