Merge pull request #159 from 7w1/fix-pronoun-clamp

fix pronoun clamp and swap update weight
This commit is contained in:
7w1 authored and GitHub committed 2026-03-05 15:24:01 -06:00
commit 9a204e0ea5
2 files changed
+17 -8

No files matched your search

@@ -1,5 +1,5 @@
---
sable: minor
sable: patch
---
Add option to filter user pronouns based on the pronouns language
+16 -7
View File
@@ -29,13 +29,22 @@ export function filterPronounsByLanguage(
enabled: boolean,
languages: string[]
): { summary: string; language?: string }[] {
if (!enabled) return pronouns;
const normalizedLanguages = languages.map((lang) => lang.trim().toLowerCase());
const filteredPronouns = pronouns.filter((p) =>
normalizedLanguages.includes((p.language || 'en').trim().toLowerCase())
);
if (filteredPronouns.length === 0) {
return pronouns;
if (!enabled) {
return pronouns.map((p) => ({ ...p, summary: p.summary.slice(0, 16) }));
}
const normalizedLanguages = languages.map((lang) => lang.trim().toLowerCase());
const filteredPronouns = pronouns
.filter((p) => normalizedLanguages.includes((p.language || 'en').trim().toLowerCase()))
.map((p) => ({
...p,
summary: p.summary.slice(0, 16),
}));
if (filteredPronouns.length === 0) {
return pronouns.map((p) => ({ ...p, summary: p.summary.slice(0, 16) }));
}
return filteredPronouns;
}