How houbb/sensitive-word works
sensitive-word is a Java library for detecting and masking sensitive text with a DFA-based matcher. The main workflow is: an application configures and initializes the fluent builder, submits text for matching, then receives a containment answer, matched words, or replacement text. Configuration supports formatting variants, allow/deny lists, specialized checks, ignored characters, and tags; result handlers shape match output. The graph combines sampled implementation references with README-documented capabilities. Some implementation details are unsampled, so documented but unverified links are dashed.
Main entry points: SensitiveWordBs.java Fluent builder · SensitiveWord.java DFA matcher · SensitiveWordHelper.java Convenience API · WordResult.java Match results
Components 17
Configuration and API
- Fluent builder
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Runtime context
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordContext.java - Convenience API
src/main/java/com/github/houbb/sensitive/word/core/SensitiveWordHelper.java
Matching and dictionaries
- DFA matcher
src/main/java/com/github/houbb/sensitive/word/core/SensitiveWord.java - Matcher base
src/main/java/com/github/houbb/sensitive/word/core/AbstractSensitiveWord.java - Deny dictionary
src/main/java/com/github/houbb/sensitive/word/support/data/WordDataTree.java - Allow dictionary
src/main/java/com/github/houbb/sensitive/word/support/allow/WordAllows.java
Normalization and policies
- Word checks
src/main/java/com/github/houbb/sensitive/word/support/check/WordCheckWord.java - Special checks
src/main/java/com/github/houbb/sensitive/word/support/check/WordChecks.java - Format variants
src/main/java/com/github/houbb/sensitive/word/support/format/WordFormats.java - Text mappings
src/main/java/com/github/houbb/sensitive/word/support/format/mapping/WordFormatTexts.java - Character skipping
src/main/java/com/github/houbb/sensitive/word/support/ignore/SensitiveWordCharIgnores.java - Word tags
src/main/java/com/github/houbb/sensitive/word/support/tag/WordTags.java
Results and masking
- Match results
src/main/java/com/github/houbb/sensitive/word/support/result/WordResult.java - Result handlers
src/main/java/com/github/houbb/sensitive/word/support/result/WordResultHandlers.java - Replacement
src/main/java/com/github/houbb/sensitive/word/support/replace/WordReplaces.java
Other components
- Application
Connections 24
- Application → Fluent builder: configures
README.md - Application → Convenience API: submits text
README.md - Fluent builder → Runtime context: builds context
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Fluent builder → Deny dictionary: initializes words
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Fluent builder → Allow dictionary: configures allowlist
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Fluent builder → DFA matcher: dispatches searches
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Fluent builder → Match results: returns matches
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Convenience API → Fluent builder: uses defaults
README.md - DFA matcher → Matcher base: extends
src/main/java/com/github/houbb/sensitive/word/core/SensitiveWord.java - DFA matcher → Deny dictionary: queries words
src/main/java/com/github/houbb/sensitive/word/core/SensitiveWord.java - DFA matcher → Runtime context: reads settings
src/main/java/com/github/houbb/sensitive/word/core/SensitiveWord.java - DFA matcher → Word checks: checks candidates
src/main/java/com/github/houbb/sensitive/word/support/check/WordCheckWord.java - DFA matcher → Match results: creates matches
src/main/java/com/github/houbb/sensitive/word/core/SensitiveWord.java - DFA matcher → Format variants: normalizes input
src/main/java/com/github/houbb/sensitive/word/core/SensitiveWord.java - Fluent builder → Format variants: selects formats
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Fluent builder → Text mappings: configures mappings
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Fluent builder → Character skipping: configures skipping
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Fluent builder → Special checks: selects checks
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Fluent builder → Word tags: configures tags
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Match results → Result handlers: processed by
README.md - Result handlers → Word tags: looks up tags
- Fluent builder → Replacement: selects strategy
src/main/java/com/github/houbb/sensitive/word/bs/SensitiveWordBs.java - Convenience API → Match results: finds matches
README.md - Convenience API → Replacement: masks text
README.md