diff --git a/.changeset/bright-languages-grow.md b/.changeset/bright-languages-grow.md
new file mode 100644
index 0000000..61af20a
--- /dev/null
+++ b/.changeset/bright-languages-grow.md
@@ -0,0 +1,6 @@
+---
+"profanity-kit": minor
+---
+
+Revise and expand the reviewed English and Indonesian dictionaries, adding
+new entries and removing excluded variants to improve language-pack quality.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index cd3a9e6..f4c511a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -39,6 +39,8 @@ To change an existing language dictionary:
To add a new language pack:
+- Open an issue before beginning substantial corpus work so scope and review
+ expectations can be agreed first.
- Create `dictionaries/
-
+
@@ -23,31 +23,43 @@ GitHub
-Profanity Kit provides predictable, synchronous word filtering without a -moderation service or an opaque machine-learning model. It is a deterministic -profanity detection toolkit, not a contextual moderation or toxicity -classifier. +Profanity Kit is a language-pack-based profanity detection toolkit built for +multilingual applications. Select and combine only the languages you need, or +provide custom packs for specific communities. English and Indonesian packs +are available today, with **more built-in languages coming soon!** + +It provides predictable, synchronous word filtering without a moderation +service or an opaque machine-learning model. It is a deterministic profanity +detection toolkit, not a contextual moderation or toxicity classifier. ## Why Profanity Kit? - Unicode-aware, whole-word matching -- Explicit, bundle-friendly language packs +- Built-in English and Indonesian packs, with more languages planned +- Explicit, bundle-friendly multilingual configuration - Detailed match metadata with source offsets - Immutable detector configuration - Synchronous and runtime agnostic - Zero runtime dependencies -## Installation +## Available languages -> Profanity Kit is in pre-release. The `next` channel will become available -> during the release rehearsal. +| Language | Import | +| ---------- | ---------------------------- | +| English | `profanity-kit/languages/en` | +| Indonesian | `profanity-kit/languages/id` | -| Package manager | Command | -| --------------- | -------------------------------- | -| npm | `npm install profanity-kit@next` | -| pnpm | `pnpm add profanity-kit@next` | -| Yarn | `yarn add profanity-kit@next` | -| Bun | `bun add profanity-kit@next` | +Language packs can be used independently or combined in one detector. Custom +packs support additional languages and communities. + +## Installation + +| Package manager | Command | +| --------------- | --------------------------- | +| npm | `npm install profanity-kit` | +| pnpm | `pnpm add profanity-kit` | +| Yarn | `yarn add profanity-kit` | +| Bun | `bun add profanity-kit` | ## Quick start @@ -62,18 +74,23 @@ detector.check("This contains shit"); // true detector.filter("Hide the shit"); // "Hide the ****" ``` -Use the dictionary-free core when selecting another language explicitly: +Use the dictionary-free core to combine the built-in English and Indonesian +language packs: ```ts import { createDetector } from "profanity-kit/core"; +import { english } from "profanity-kit/languages/en"; import { indonesian } from "profanity-kit/languages/id"; -const detector = createDetector({ languages: [indonesian] }); +const detector = createDetector({ languages: [english, indonesian] }); +detector.check("This contains shit"); // true detector.check("Dasar goblok"); // true -detector.filter("Dasar goblok"); // "Dasar ******" ``` +Load either pack independently when only one language is needed, or supply a +custom language pack for another language or community. + ## Learn more - [Quick Start](https://profanity-kit.up2dul.dev/quick-start) diff --git a/apps/docs/src/content/docs/core-concepts/languages.mdx b/apps/docs/src/content/docs/core-concepts/languages.mdx index 3971a6d..5df30ed 100644 --- a/apps/docs/src/content/docs/core-concepts/languages.mdx +++ b/apps/docs/src/content/docs/core-concepts/languages.mdx @@ -8,6 +8,19 @@ sidebar: Profanity Kit separates its detector engine from language dictionaries. Choose the entry point based on who should control the language data. +English and Indonesian are available as built-in language packs today. You can +use either independently, combine both for multilingual input, or provide a +custom pack for another language or community. + +## Available languages + +| Language | Import | +| ---------- | ---------------------------- | +| English | `profanity-kit/languages/en` | +| Indonesian | `profanity-kit/languages/id` | + +## Choose an entry point + | Import | Dictionaries | Best for | | -------------------- | -------------------------- | ----------------------------------------------------------------- | | `profanity-kit` | English included | English-only applications and shortest setup | @@ -82,3 +95,17 @@ selection or bundle composition should be explicit. You can also supply a custom [`LanguagePack`](/api/types#languagepack). See [Customization](/guides/customization#create-a-custom-language-pack) for a complete example. + +## More languages + +More built-in language packs are planned, but there is no committed language +list or release schedule. Until a built-in pack is available, applications can +provide a custom language pack through the same core API. + +Native speakers and community reviewers are welcome to propose or contribute a +new built-in pack. Open a +[GitHub issue](https://github.com/up2dul/profanity-kit/issues) before beginning +substantial corpus work, then follow the +[contribution guide](https://github.com/up2dul/profanity-kit/blob/main/CONTRIBUTING.md#dictionary-contributions) +and +[dictionary review policy](https://github.com/up2dul/profanity-kit/blob/main/dictionaries/README.md). diff --git a/apps/docs/src/content/docs/index.mdx b/apps/docs/src/content/docs/index.mdx index d1154db..e9efe29 100644 --- a/apps/docs/src/content/docs/index.mdx +++ b/apps/docs/src/content/docs/index.mdx @@ -1,6 +1,6 @@ --- title: Profanity Kit -description: A small, Unicode-aware profanity detector for TypeScript. +description: A multilingual, Unicode-aware profanity detector for TypeScript. sidebar: order: 1 badge: Start here @@ -8,10 +8,14 @@ sidebar: ## Introduction -Profanity Kit is a TypeScript toolkit for detecting configured profane words as -complete, Unicode-aware tokens. It provides detection mechanisms, language -dictionaries, and customization primitives—not a universal list that every -application must reject. +Profanity Kit is a language-pack-based TypeScript toolkit built for multilingual +applications. Select and combine only the languages you need, or provide custom +packs for specific communities. English and Indonesian packs are available +today, with more built-in packs planned. + +It detects configured profane words as complete, Unicode-aware tokens and +provides customization primitives—not a universal list that every application +must reject. "Profanity" commonly means language considered offensive or taboo in a social context; its meaning and impact vary by community and situation. See the @@ -39,4 +43,13 @@ That variation is why dictionaries stay explicit and detectors immutable. Try matching interactively + +@@ -23,31 +23,43 @@ GitHub
-Profanity Kit provides predictable, synchronous word filtering without a -moderation service or an opaque machine-learning model. It is a deterministic -profanity detection toolkit, not a contextual moderation or toxicity -classifier. +Profanity Kit is a language-pack-based profanity detection toolkit built for +multilingual applications. Select and combine only the languages you need, or +provide custom packs for specific communities. English and Indonesian packs +are available today, with **more built-in languages coming soon!** + +It provides predictable, synchronous word filtering without a moderation +service or an opaque machine-learning model. It is a deterministic profanity +detection toolkit, not a contextual moderation or toxicity classifier. ## Why Profanity Kit? - Unicode-aware, whole-word matching -- Explicit, bundle-friendly language packs +- Built-in English and Indonesian packs, with more languages planned +- Explicit, bundle-friendly multilingual configuration - Detailed match metadata with source offsets - Immutable detector configuration - Synchronous and runtime agnostic - Zero runtime dependencies -## Installation +## Available languages -> Profanity Kit is in pre-release. The `next` channel will become available -> during the release rehearsal. +| Language | Import | +| ---------- | ---------------------------- | +| English | `profanity-kit/languages/en` | +| Indonesian | `profanity-kit/languages/id` | -| Package manager | Command | -| --------------- | -------------------------------- | -| npm | `npm install profanity-kit@next` | -| pnpm | `pnpm add profanity-kit@next` | -| Yarn | `yarn add profanity-kit@next` | -| Bun | `bun add profanity-kit@next` | +Language packs can be used independently or combined in one detector. Custom +packs support additional languages and communities. + +## Installation + +| Package manager | Command | +| --------------- | --------------------------- | +| npm | `npm install profanity-kit` | +| pnpm | `pnpm add profanity-kit` | +| Yarn | `yarn add profanity-kit` | +| Bun | `bun add profanity-kit` | ## Quick start @@ -62,18 +74,23 @@ detector.check("This contains shit"); // true detector.filter("Hide the shit"); // "Hide the ****" ``` -Use the dictionary-free core when selecting another language explicitly: +Use the dictionary-free core to combine the built-in English and Indonesian +language packs: ```ts import { createDetector } from "profanity-kit/core"; +import { english } from "profanity-kit/languages/en"; import { indonesian } from "profanity-kit/languages/id"; -const detector = createDetector({ languages: [indonesian] }); +const detector = createDetector({ languages: [english, indonesian] }); +detector.check("This contains shit"); // true detector.check("Dasar goblok"); // true -detector.filter("Dasar goblok"); // "Dasar ******" ``` +Load either pack independently when only one language is needed, or supply a +custom language pack for another language or community. + ## Learn more - [Quick Start](https://profanity-kit.up2dul.dev/quick-start) diff --git a/packages/profanity-kit/src/generated/en.ts b/packages/profanity-kit/src/generated/en.ts index 0cbfa1e..a17790d 100644 --- a/packages/profanity-kit/src/generated/en.ts +++ b/packages/profanity-kit/src/generated/en.ts @@ -1,131 +1,288 @@ // Generated by scripts/generate-dictionaries.mjs; do not edit manually. export const words = Object.freeze([ + "apeshit", "arse", + "arseface", + "arsehat", + "arsehats", + "arsehead", "arsehole", "arseholes", - "arses", + "arselicker", + "arsemunch", "arsewipe", "arsewipes", "ass", "assbag", + "assbags", + "assbandit", + "assbanger", + "assbite", + "assblaster", "assclown", + "assclowns", + "asscock", + "asscrack", + "asscracker", "asses", "assface", "assfaces", + "assfuck", + "assfucker", + "assfuckers", + "assfucking", + "assfucks", + "assgoblin", "asshat", "asshats", "asshead", + "assheads", "asshole", "assholes", + "assjockey", + "asskisser", + "asslick", + "asslicker", + "asslickers", + "asslover", + "assmaster", + "assmonkey", + "assmonkeys", + "assmunch", + "assmuncher", + "assmunchers", + "assrammer", + "assshit", + "asssucker", "asswad", + "asswads", + "asswhole", + "asswhore", "asswipe", "asswipes", "ballbag", + "balllicker", "ballsack", + "ballsacks", + "bampot", + "bassterd", "bastard", "bastards", - "batshit", + "basterd", "bellend", "bellends", - "beotch", "biatch", + "bint", "bitch", "bitchass", + "bitchasses", + "bitchbag", + "bitchboy", "bitched", "bitcher", "bitchers", "bitches", + "bitchface", + "bitchfaces", + "bitchhead", "bitchin", "bitching", "bitchslap", + "bitchtits", "bitchy", + "bloody", "bollock", + "bollocking", + "bollockings", "bollocks", + "bollok", + "bollox", + "boner", "bugger", "buggered", - "buggering", - "buggers", "bullcrap", "bullshit", "bullshits", "bullshitted", + "bullshitter", + "bullshitters", "bullshitting", "bumfuck", + "bunghole", + "buttface", + "buttfuck", + "buttfucked", + "buttfucker", + "buttfuckers", + "buttfucking", "butthead", "butthole", + "buttholes", "buttmunch", + "buttmuncher", + "buttwipe", + "byatch", + "choad", + "chode", + "chodes", "clusterfuck", - "clusterfucked", - "clusterfucking", - "clusterfucks", "cock", + "cockbag", + "cockbags", + "cockbite", + "cockbites", + "cockblock", + "cockblocker", + "cockburger", + "cockburgers", "cockface", + "cockfucker", + "cockfuckers", "cockhead", "cockheads", - "cockmunch", + "cockjockey", + "cockknob", + "cockknocker", + "cocklick", + "cocklicker", + "cockmaster", + "cockmasters", + "cockmongler", + "cockmonglers", "cockmuncher", + "cocknob", + "cocknose", + "cocknoses", + "cocknugget", + "cockring", "cocks", + "cockshit", + "cocksmoker", + "cocksniffer", + "cocksniffers", "cocksuck", - "cocksucked", "cocksucker", "cocksuckers", "cocksucking", - "cocksucks", + "coochie", + "cooter", + "cornhole", "crap", + "craphead", + "crapheads", "crapola", "crapped", "crapper", + "crappers", "crapping", "crappy", - "craps", + "cuck", + "cum", + "cumbubble", + "cumdump", + "cumdumps", + "cumdumpster", + "cumguzzler", + "cumjockey", + "cumming", + "cumrag", + "cums", + "cumshot", + "cumshots", + "cumslut", + "cumsluts", + "cumstain", + "cumsucker", "cunt", + "cuntbag", "cuntface", + "cunthead", "cunthole", + "cunting", + "cuntlick", + "cuntlicker", + "cuntrag", "cunts", - "cunty", + "cuntsucker", + "damm", "dammit", "damn", + "damnation", "damned", + "damning", "damnit", "dick", "dickbag", + "dickbagger", + "dickbags", "dickbrain", + "dickbrains", + "dickbreath", + "dickbreaths", "dickface", - "dickfaces", + "dickfucker", "dickhead", "dickheads", "dickhole", - "dickish", + "dickholes", + "dickless", + "dicklick", + "dicklicker", + "dicklickers", + "dicklicking", + "dickmunch", "dicks", - "dickslap", + "dicksucker", "dickwad", "dickwads", + "dickwank", "dickweed", + "dickweeds", + "dildo", + "dildos", "dipshit", "dipshits", "dipstick", - "doochbag", - "doosh", "douche", "douchebag", "douchebags", - "douches", + "douchecanoe", + "doucheface", "douchewaffle", "dumbass", "dumbasses", "dumbfuck", - "dumbshit", - "englishsentinel", - "fck", - "fcuk", + "dumbfucks", + "facefucker", + "fanny", + "fartknocker", + "fatass", "feck", "fecker", "ffs", + "fingerfuck", + "fingerfucked", + "fingerfucker", + "fingerfucking", + "fistfuck", + "fistfucked", + "fistfucker", + "fistfucking", + "frigga", + "frigger", "fuck", "fuckass", + "fuckasses", "fuckbag", + "fuckbags", + "fuckbitch", "fuckboy", "fuckboys", + "fuckbrain", + "fuckbrains", + "fuckbucket", + "fuckbuckets", + "fuckbutt", "fucked", "fucker", "fuckers", @@ -133,40 +290,36 @@ export const words = Object.freeze([ "fuckfaces", "fuckhead", "fuckheads", + "fuckhole", "fuckin", "fucking", "fuckknob", + "fuckknuckle", + "fuckmeat", + "fuckmonkey", "fucknugget", "fucknut", "fucknuts", "fuckoff", + "fuckpig", + "fuckpuppet", "fucks", "fuckstick", - "fucksticks", "fucktard", "fucktards", + "fucktart", "fuckup", - "fuckups", "fuckwad", "fuckwads", + "fuckweasel", "fuckwhit", + "fuckwhore", "fuckwit", "fuckwits", - "fuckwitt", - "fuckyou", + "fuckwitted", "fugly", - "fuk", - "fuker", - "fukin", - "fuking", - "fukk", - "fukka", - "fukker", - "fukkin", - "fukking", - "fuuck", "fvck", - "fxck", + "gassyass", "godammit", "godamn", "godamnit", @@ -176,84 +329,160 @@ export const words = Object.freeze([ "goddamn", "goddamned", "goddamnit", - "gtfo", "horseshit", "jackass", "jackasses", "jackoff", "jackoffs", + "jackshit", "jerkoff", "jerkoffs", + "knob", + "knobber", + "knobend", + "knobends", + "knobhead", + "knobheads", + "minge", + "minger", + "mingers", + "mothafucka", + "mothafuckas", + "mothafuckaz", + "mothafucker", "motherfuck", "motherfucked", "motherfucker", "motherfuckers", + "motherfuckin", "motherfucking", "motherfucks", + "muthafucka", + "muthafucker", + "nutsack", + "nutsacks", "piss", + "pissant", + "pissbag", + "pissbrain", + "pissbucket", "pissed", + "pissedoff", "pisser", "pissers", "pisses", + "pissface", + "pissfaces", + "pissflap", + "pissflaps", + "pissfuck", "pisshead", "pissheads", + "pisshole", "pissing", + "pisspot", + "pisspots", "prick", "pricks", "pussies", "pussy", "shit", "shitass", + "shitasses", "shitbag", + "shitbagger", "shitbags", + "shitbird", + "shitbox", + "shitbrain", + "shitbrains", + "shitbreath", + "shitbreaths", + "shitbucket", + "shitbuckets", + "shitcunt", + "shitdick", "shite", "shited", "shitface", "shitfaced", "shitfaces", + "shitfuck", + "shitfucker", + "shitfuckers", "shithead", "shitheads", + "shitheel", "shithole", "shitholes", + "shitlist", + "shitload", + "shitloads", + "shitlord", + "shitpile", + "shitpot", "shits", + "shitsack", "shitshow", - "shitshows", "shitstain", "shitstains", "shitstorm", - "shitstorms", + "shitted", "shitter", "shitters", "shittier", "shittiest", "shitting", "shitty", + "shitwad", + "shitweasel", + "shitwit", "skank", "skanks", + "skanky", + "slag", + "slags", + "slapper", + "slappers", "slut", "sluts", "slutty", + "sodoff", + "sonofabitch", "stfu", + "tit", + "tits", + "titties", + "titty", "tosser", "tossers", + "turd", + "turdface", + "turdhead", + "turds", "twat", "twathead", "twats", - "twatty", + "twatwaffle", "wank", + "wankbag", "wanked", "wanker", "wankers", + "wankface", + "wankfest", "wanking", "wankjob", "wanks", - "wanky", + "wankshaft", + "wankshit", + "wankstain", + "wankstains", + "wazzock", "whore", - "whorebag", - "whored", - "whoreface", "whores", "whoring", + "whorish", "wtf", ] as const); -export const version = "0.2.0"; +export const version = "0.3.0"; diff --git a/packages/profanity-kit/src/generated/id.ts b/packages/profanity-kit/src/generated/id.ts index 17e0844..a23d182 100644 --- a/packages/profanity-kit/src/generated/id.ts +++ b/packages/profanity-kit/src/generated/id.ts @@ -1,130 +1,225 @@ // Generated by scripts/generate-dictionaries.mjs; do not edit manually. export const words = Object.freeze([ + "ancok", + "ancuk", + "ancuruk", "anjay", + "anjg", "anjim", "anjing", - "anjingan", "anjir", - "anjirr", + "anjng", "anjrit", "anjrot", "anying", + "anyir", "asu", + "asuwo", + "asw", "babi", + "bacod", "bacot", - "bagudung", + "bacotnya", + "bajindul", + "bajing", + "bajingak", "bajingan", + "bajinguk", + "bajirut", "bangke", + "bangkean", + "bangor", "bangsat", + "bangsatkau", + "bangsatmu", + "bangsatnya", "bedebah", "bego", + "begoan", "bejad", "bejat", - "bloon", + "bjir", + "blok", "bodat", + "borjong", "brengsek", + "bujanginam", + "bujanginang", "bungul", "burit", - "chibai", + "celeng", "cibai", "cibay", "cocot", + "cocote", "cok", + "cokil", + "colai", "coli", "colmek", - "congor", "cuk", "cuki", "cukimai", + "cukimak", "cukimay", - "cukin", + "damput", + "dancik", "dancok", "dancuk", - "dientot", - "dientotin", + "diancuk", + "dongo", + "dongok", + "encuk", "entot", "ewe", - "gathel", - "gatheli", "gembel", "goblog", + "goblognya", "goblok", + "heang", "hencet", "henceut", "idiot", - "indonesiansentinel", + "itil", "jablai", "jablay", "jancik", "jancok", + "jancokmu", + "jancoknya", + "jancox", "jancuk", - "jancur", + "jancukmu", + "jancuknya", + "jancux", + "jembot", "jembut", + "jembutmu", + "jembutnya", + "jing", + "jingan", "kacuk", "kampang", "kampret", + "kampretmu", "kanciang", + "kelentit", + "kemem", "keparat", + "keparatnya", "kimak", - "kimcil", - "kintil", + "kimakmu", + "kimaknya", + "kimbek", + "kimpet", "kirik", + "klentit", "kolop", "konthol", "kontol", + "kontolan", + "kontolkau", + "kontollo", + "kontollu", + "kontolmu", + "kontolnya", "koplok", "kunyuk", "kwontol", + "ler", "lonte", + "lonteh", + "lotnok", "mampus", - "meki", + "mek", "memek", - "mengentot", - "mengentoti", - "mengentotin", + "memekmu", + "memeknya", "modar", + "modyar", + "mokad", "monyet", + "ndas", "ndasmu", + "ndhas", "ndhasmu", + "ndlogok", "nenen", - "ngehe", + "ngentod", "ngentot", - "ngentotin", + "ngentotnya", "ngewe", + "nggateli", + "ngolom", "ngulum", + "njing", + "njir", + "ogeb", + "palkon", + "palkor", "pantat", "pantek", - "pecun", - "peju", + "pantekmu", + "panteknya", + "pekok", + "pekokmu", "peler", + "pelerkau", + "pelerlo", + "pelerlu", + "pelermu", "pentil", "pepek", + "pepeklo", + "pepeklu", + "pepekmu", + "pepeknya", "perek", - "pilat", + "pler", "puki", + "pukima", "pukimak", + "pukimaknya", "qontol", + "sange", "sarap", + "sat", "sempak", + "setan", "sial", "sialan", + "sialanmu", "silit", "sinting", - "sompret", "sontoloyo", - "sundal", "taek", + "taeknya", "tahi", "tai", - "tailaso", + "taiayam", + "taik", + "taiklo", + "taiklu", + "taikmu", + "taiknya", "telaso", + "telek", "tempek", "tempik", + "tete", "tetek", "titit", + "tititmu", + "titiw", "toket", + "toketmu", "tolol", - "totong", + "tolollo", + "tolollu", + "tololmu", + "tololnya", + "tot", "tusbol", + "wedus", ] as const); -export const version = "0.2.0"; +export const version = "0.3.0"; diff --git a/packages/profanity-kit/src/index.test.ts b/packages/profanity-kit/src/index.test.ts index 58f9140..52c1943 100644 --- a/packages/profanity-kit/src/index.test.ts +++ b/packages/profanity-kit/src/index.test.ts @@ -11,16 +11,16 @@ describe("public entry points", () => { const detector = createDetector(); expectTypeOf(detector).toEqualTypeOf