#17 · Primary category: NLP Tools & Text Processing

sensitive-word

dfa dirty-word filter java nlp pinyin search sensitive sensitive-word sensitive-word-filter string-matching textfliter trie-tree

👮‍♂️The sensitive word tool for java.

Project last updated:03/23/26

GitHub Stars

6.0K

Forks

806

Contributors

11

License

Apache-2.0

Why we included this project

Most Java services that accept user input eventually need a way to catch bad words, and this library does that without sending text off to a remote API. It's built around a DFA matcher that keeps up with production traffic, ships with a built-in lexicon of over 60,000 terms, and lets you add your own blacklists, whitelists, and replacement rules. The normalization layer is what makes it useful: it handles full-width and half-width characters, simplified and traditional Chinese, converts Han characters to pinyin, and ignores repeated or skipped characters, so obfuscated spellings are less likely to slip through. You can also tag matches by category, detect emails, URLs, IPs, and numbers, and swap in new words at runtime without rebuilding the index. For a self-contained, low-latency moderation option in Java, this is a reasonable starting point.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category