Wordlist
The default list covers Arabic script, Franco-arabe / Maghrebi Latin, French, English, and Tamazight (Kabyle, Chaoui, Mzabi, Saharan). Counts are exported as WORDLIST_STATS.
ts
import { WORDLIST_STATS } from "anti-ttyah";
WORDLIST_STATS.terms
WORDLIST_STATS.phrases
WORDLIST_STATS.byLang // ar, ar-latn, fr, en, tz
WORDLIST_STATS.byCategory // sexual, insult, slur, mildDo not paste the list into issues, READMEs, or social posts. Point at a file and a line range instead.
Extend without forking
Project-specific terms belong in createFilter, not in a pull request for every local insult:
ts
const filter = createFilter({
extraTerms: ["customslur"],
extraPhrases: ["not allowed"],
allowlist: ["h*ar"],
});PROFANITY_TERMS and PROFANITY_PHRASES remain string[] for compatibility. Tagged entries live in PROFANITY_TERM_ENTRIES / PROFANITY_PHRASE_ENTRIES (term, lang, category).
Adding terms (contributors)
- Single tokens →
PROFANITY_TERM_ENTRIES. - Multi-word expressions →
PROFANITY_PHRASE_ENTRIES. - Do not add every Franco-arabe spelling. Normalization already folds
3/7/9, repeats,ة/ه,أ/إ/آ, and separators. - Stay conservative. If a word is also a normal product name or given name, document an
allowlistexample instead. - Add a focused test when matching behavior changes. Do not dump the whole list into a test file.