openvibers/openvibe.live Commits
The home's quote strip also leaves out strong profanity in Portuguese, Spanish, French and German (#346)
Changes
@@@ -8,12 +8,15 @@const { CORE_SLUR_CATEGORIES } = require('../chat/moderation-utils');const ROUGH = /\b(?:f+u+c+k\w*|motherf\w*|sh[i1]t(?:s|ty|ting|ted)?|bullshit|cunts?|bitch\w*|whores?|sluts?|pussy|retard\w*|nazis?|hitler|holocaust|anti-?semit\w*|kkk|rap(?:e|ed|es|ist|ists|ing))\b/i;++// Streamers here speak Portuguese, Spanish, French and German too ("…tô com o rollback do caralho" led the strip on++// 2026-10-24 once the English words were out). Letter boundaries, not \b: \b does not know ç, ñ or ß.++const ROUGH_INTL = /(?<!\p{L})(?:caralho|porra|foda(?:-se)?|fodase|merda|putas?|viado|buceta|mierda|joder|coño|pendejos?|cabr[oó]n(?:es)?|verga|chinga\p{L}*|putain|merde|connard|salope|scheiße|scheisse|hurensohn|ficken|fick)(?!\p{L})/iu;const SLUR_RES = CORE_SLUR_CATEGORIES.map((c) => ({ c, res: c.patterns.map((p) => new RegExp(p, 'i')) }));/** True when the text may lead the front page. */function frontPageOk(text) {const t = String(text || '');-- if (!t.trim() || ROUGH.test(t)) return false;++ if (!t.trim() || ROUGH.test(t) || ROUGH_INTL.test(t)) return false;return !SLUR_RES.some(({ c, res }) => c.generateCandidates(t).some((x) => res.some((re) => re.test(x))));}@@@ -16,11 +16,13 @@ for (const t of ['I had Hermes say, oh, that\'s got an anti-semitic trope. I can\'t help.','that was some bullshit', 'what a bitch move', 'he went full nazi on it', 'the Holocaust bit again','n1gger', 'f a g g o t', 'Motherfucker!', '', null,++ 'Eita, pô, tô com tô com o rollback do caralho.', 'Que porra é essa', '¡Joder, qué mierda!', 'putain de merde', 'So eine Scheiße',]) assert.ok(!frontPageOk(t), `left off the front page: ${t}`);for (const t of ['That first time I walked in, I knew that I was not alone.', 'We finally beat the boss on hard mode','Shitake mushrooms are underrated', 'My dad Dick says hi', 'Scunthorpe won again', 'Grape soda forever','The cockpit view in this sim is amazing',++ 'Eita, pô, tô com o rollback do servidor.', 'O computador travou de novo', 'Hola a todos, ¿qué tal?', 'Disputa final hoje',]) assert.ok(frontPageOk(t), `fine for the front page: ${t}`);console.log(' ✓ slurs, strong profanity and hate topics are left off; ordinary takes (and Shitake, Scunthorpe, grape) stay');
@@ -8,12 +8,15 @@
@@ -8,12 +8,15 @@
const { CORE_SLUR_CATEGORIES } = require('../chat/moderation-utils');
const { CORE_SLUR_CATEGORIES } = require('../chat/moderation-utils');
const ROUGH = /\b(?:f+u+c+k\w*|motherf\w*|sh[i1]t(?:s|ty|ting|ted)?|bullshit|cunts?|bitch\w*|whores?|sluts?|pussy|retard\w*|nazis?|hitler|holocaust|anti-?semit\w*|kkk|rap(?:e|ed|es|ist|ists|ing))\b/i;
const ROUGH = /\b(?:f+u+c+k\w*|motherf\w*|sh[i1]t(?:s|ty|ting|ted)?|bullshit|cunts?|bitch\w*|whores?|sluts?|pussy|retard\w*|nazis?|hitler|holocaust|anti-?semit\w*|kkk|rap(?:e|ed|es|ist|ists|ing))\b/i;
+// Streamers here speak Portuguese, Spanish, French and German too ("…tô com o rollback do caralho" led the strip on
+// 2026-10-24 once the English words were out). Letter boundaries, not \b: \b does not know ç, ñ or ß.
+const ROUGH_INTL = /(?<!\p{L})(?:caralho|porra|foda(?:-se)?|fodase|merda|putas?|viado|buceta|mierda|joder|coño|pendejos?|cabr[oó]n(?:es)?|verga|chinga\p{L}*|putain|merde|connard|salope|scheiße|scheisse|hurensohn|ficken|fick)(?!\p{L})/iu;
const SLUR_RES = CORE_SLUR_CATEGORIES.map((c) => ({ c, res: c.patterns.map((p) => new RegExp(p, 'i')) }));
const SLUR_RES = CORE_SLUR_CATEGORIES.map((c) => ({ c, res: c.patterns.map((p) => new RegExp(p, 'i')) }));
/** True when the text may lead the front page. */
/** True when the text may lead the front page. */
function frontPageOk(text) {
function frontPageOk(text) {
const t = String(text || '');
const t = String(text || '');
- if (!t.trim() || ROUGH.test(t)) return false;
+ if (!t.trim() || ROUGH.test(t) || ROUGH_INTL.test(t)) return false;
return !SLUR_RES.some(({ c, res }) => c.generateCandidates(t).some((x) => res.some((re) => re.test(x))));
return !SLUR_RES.some(({ c, res }) => c.generateCandidates(t).some((x) => res.some((re) => re.test(x))));
}
}
@@ -16,11 +16,13 @@ for (const t of [
@@ -16,11 +16,13 @@ for (const t of [
'I had Hermes say, oh, that\'s got an anti-semitic trope. I can\'t help.',
'I had Hermes say, oh, that\'s got an anti-semitic trope. I can\'t help.',
'that was some bullshit', 'what a bitch move', 'he went full nazi on it', 'the Holocaust bit again',
'that was some bullshit', 'what a bitch move', 'he went full nazi on it', 'the Holocaust bit again',
'n1gger', 'f a g g o t', 'Motherfucker!', '', null,
'n1gger', 'f a g g o t', 'Motherfucker!', '', null,
+ 'Eita, pô, tô com tô com o rollback do caralho.', 'Que porra é essa', '¡Joder, qué mierda!', 'putain de merde', 'So eine Scheiße',
]) assert.ok(!frontPageOk(t), `left off the front page: ${t}`);
]) assert.ok(!frontPageOk(t), `left off the front page: ${t}`);
for (const t of [
for (const t of [
'That first time I walked in, I knew that I was not alone.', 'We finally beat the boss on hard mode',
'That first time I walked in, I knew that I was not alone.', 'We finally beat the boss on hard mode',
'Shitake mushrooms are underrated', 'My dad Dick says hi', 'Scunthorpe won again', 'Grape soda forever',
'Shitake mushrooms are underrated', 'My dad Dick says hi', 'Scunthorpe won again', 'Grape soda forever',
'The cockpit view in this sim is amazing',
'The cockpit view in this sim is amazing',
+ 'Eita, pô, tô com o rollback do servidor.', 'O computador travou de novo', 'Hola a todos, ¿qué tal?', 'Disputa final hoje',
]) assert.ok(frontPageOk(t), `fine for the front page: ${t}`);
]) assert.ok(frontPageOk(t), `fine for the front page: ${t}`);
console.log(' ✓ slurs, strong profanity and hate topics are left off; ordinary takes (and Shitake, Scunthorpe, grape) stay');
console.log(' ✓ slurs, strong profanity and hate topics are left off; ordinary takes (and Shitake, Scunthorpe, grape) stay');