Changelog
0.2.0 (unreleased)
Same word lists and matching rules as the JavaScript package 0.2.0.
- Many more English words, including slurs (
fag,faggot,nigger…) and compounds (shitface,dipshit,jackass…), and more Romanized and Devanagari Nepali words (jhant,lauda,chhinal,gadha,ullu…). - New English words at the strict level that are also ordinary words:
damn,cum,prick,hoeand others. shitis now a stem, soshitfaceandshittingare caught. Names that start with it, like Shitij and Shital, are on the allow list.- A built-in allow list of names and ordinary words, like Randip, Shitij, conditions and Scunthorpe, that are never flagged. The strict level no longer flags them.
- A few roots, like
fuckandbitch, are caught inside a longer word:dumbfuck,sonofabitch. xis read aschhin Romanized Nepali, soxakkamatcheschhakka.chhod("leave") andchhodnuare no longer flagged by the stemchod.- Words split by punctuation without a space are read joined:
sh.it,fu-ck. - Accents and Cyrillic or Greek look-alike letters are removed or replaced:
fück,fuсk.8reads asb,9asgand€ase. ExtraWordsoption to flag more words, andAllowWordsoption to never flag a word.
0.1.0 (2026-09-25)
First release, with the same word lists and matching rules as the JavaScript package 0.1.0.
ContainsProfanity,FindProfanityandTokenize.Censorto mask matches in place, with a customMaskor aReplacefunction.Checkto scan once, then inspect and censor the result:Check(text).Censor().FindProfanityMatchesto get each match with its byte offsets in the original text.NewFilterandMustNewFilterfor other options, safe for concurrent use.Languagesoption to check English, Romanized Nepali and Devanagari separately.Strictnessoption with three levels:Lenient,Standard(default) andStrict.- Handles leetspeak,
!and*in place of letters, stretched letters and spelled-out letters. - Handles Nepali postpositions and plurals in both scripts.
- Multi-word phrases in both scripts.
- The word lists, exported with every entry tagged by language and strictness.
- Go 1.22 or later; depends only on
golang.org/x/text.