#filter #profanity #unicode #moderation #censor

profanite-core

Kryptonite for Profanities — lightweight, obfuscation-resistant profanity filter

7 releases

0.1.9 Apr 30, 2026
0.1.8 Apr 30, 2026

#1431 in Text processing

GPL-3.0-or-later

68KB
1.5K SLoC

profanite-core

The Rust core of profanite — a lightweight, obfuscation-resistant profanity filter.

[dependencies]
profanite-core = "0.1"
use profanite_core::Profanite;

let p = Profanite::builder().build().unwrap();

p.contains_profanity("what the fuck");   // true
p.censor("what the fuck");               // "what the ****"
p.find("oh fuck that");                  // Vec<Match> with spans + category + severity

Features

  • Obfuscation-resistant: bidi-strip, NFKC, casefold, homoglyph fold, conservative leet substitution, repeated-char collapse.
  • Tiered wordlist: short ambiguous stems (e.g. ass) require word boundaries; unambiguous compounds (e.g. motherfucker) match anywhere, catching concat bypasses like Hemoglomotherfuckerbin.
  • Allowlist escape hatch for the Scunthorpe problem.
  • Bundled dictionaries from LDNOOBW (CC0) for English, Spanish, Hindi (romanized), French, German. Enable via cargo features:
profanite-core = { version = "0.1", features = ["all-langs"] }

What this is not

profanite is a keyword filter. It is not a hate-speech detector, not a slur dictionary (slurs are deliberately unbundled — supply your own), and not context-aware. See PHILOSOPHY.md in the main repo.

Benchmarks

Run cargo run -p profanite-bench -- fast in the workspace. Current numbers live in README.md.

Node.js and Python bindings

License: GPL-3.0-or-later.

Dependencies

~1.3–1.9MB
~45K SLoC