allprofanity 1.1.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,24 +1,28 @@
1
1
  # AllProfanity
2
2
 
3
- A comprehensive multi-language profanity filter for JavaScript/TypeScript applications with built-in support for English, Hindi, Hinglish, Bengali, Tamil, Telugu, French, German, and Spanish content.
3
+ A blazing-fast, multi-language, enterprise-grade profanity filter for JavaScript/TypeScript with advanced leet-speak normalization, Unicode support, and a robust, modern API.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/allprofanity.svg)](https://www.npmjs.com/package/allprofanity)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
+ ---
9
+
8
10
  ## Features
9
11
 
10
- - **Multi-language Support**: Pre-loaded with English profanities (from leo-profanity) and extensive dictionaries for Hindi/Hinglish, Bengali, Tamil, Telugu, French, German, and Spanish
11
- - **Multiple Scripts**: Detects profanity in both Latin/Roman and native scripts (Devanagari, Bengali, Tamil, Telugu)
12
- - **Case Insensitive**: Works regardless of letter case
13
- - **Flexible Cleaning Options**:
14
- - Character-level replacement (each character of a profane word becomes a placeholder)
15
- - Word-level replacement (entire profane word becomes a single placeholder)
16
- - **Customizable**:
17
- - Dynamically add/remove words from the filter
18
- - Set custom placeholder characters or strings
19
- - **Zero Dependencies**: Only depends on leo-profanity as the base filter
20
- - **TypeScript Support**: Full TypeScript type definitions included
21
- - **Extensible**: Designed with multi-language support in mind, making it easy to add more languages in the future
12
+ - **Ultra-Fast O(n) Detection:** TRIE-based, single-pass algorithm for massive performance gains over regex/set-based filters.
13
+ - **Multi-Language Support:** Built-in dictionaries for English, Hindi, French, German, Spanish, Bengali, Tamil, Telugu. Load multiple at once.
14
+ - **Multiple Scripts:** Detects profanity in Latin/Roman (Hinglish) and native scripts (e.g., Devanagari, Tamil, Telugu).
15
+ - **Advanced Leet-Speak Normalization:** Detects obfuscated profanities (`f#ck`, `a55hole`, etc.) with context-aware mapping.
16
+ - **Unicode & Punctuation Robustness:** Handles word boundaries and mixed language content with near-zero false positives.
17
+ - **Flexible Cleaning:** Replace matches character-by-character or as whole words, with configurable placeholders.
18
+ - **Custom Dictionaries:** Add/remove words or entire lists at runtime, including your own language packs.
19
+ - **Whitelisting:** Exclude safe words or false positives from detection.
20
+ - **Severity Levels:** Assess how offensive a string is (`MILD`, `MODERATE`, `SEVERE`, `EXTREME`).
21
+ - **No Dictionary Exposure:** For security, the full list of loaded profanities is never exposed.
22
+ - **TypeScript Support:** Typed, documented API and result objects.
23
+ - **Zero 3rd-Party Dependencies:** Only internal code and data.
24
+
25
+ ---
22
26
 
23
27
  ## Installation
24
28
 
@@ -26,327 +30,373 @@ A comprehensive multi-language profanity filter for JavaScript/TypeScript applic
26
30
  npm install allprofanity
27
31
  # or
28
32
  yarn add allprofanity
29
- # or
30
- pnpm add allprofanity
31
33
  ```
32
34
 
33
- ## Basic Usage
34
-
35
- ```javascript
36
- import profanity from 'allprofanity';
35
+ ---
37
36
 
38
- // Check if a string contains profanity
39
- profanity.check('This is a clean sentence.'); // false
40
- profanity.check('This is a fucking test.'); // true
41
- profanity.check('यह एक चूतिया परीक्षण है।'); // true (Hindi example)
42
- profanity.check('Ye ek chutiya test hai.'); // true (Hinglish example)
37
+ ## Quick Start
43
38
 
44
- // Clean profanity (character by character replacement)
45
- profanity.clean('This is a fucking test.');
46
- // => "This is a ****ing test."
39
+ ```typescript
40
+ import profanity from 'allprofanity';
47
41
 
48
- // Clean profanity (whole word replacement)
49
- profanity.cleanWithWord('This is a fucking test.');
50
- // => "This is a *** test."
42
+ // Simple check
43
+ profanity.check('This is a clean sentence.'); // false
44
+ profanity.check('What the f#ck is this?'); // true (leet-speak detected)
45
+ profanity.check('यह एक चूतिया परीक्षण है।'); // true (Hindi)
46
+ profanity.check('Ye ek chutiya test hai.'); // true (Hinglish Roman script)
51
47
  ```
52
48
 
53
- ## API Reference
49
+ ---
54
50
 
55
- ### `check(string: string): boolean`
51
+ ## API Reference & Examples
56
52
 
57
- Checks if a string contains any profanity from the loaded dictionaries.
53
+ ### `check(text: string): boolean`
58
54
 
59
- ```javascript
60
- profanity.check('This contains bullshit.'); // true
61
- profanity.check('This is clean.'); // false
55
+ Returns `true` if the text contains any profanity.
56
+
57
+ ```typescript
58
+ profanity.check('This is a clean sentence.'); // false
59
+ profanity.check('This is a bullshit sentence.'); // true
60
+ profanity.check('What the f#ck is this?'); // true (leet-speak)
61
+ profanity.check('यह एक चूतिया परीक्षण है।'); // true (Hindi)
62
62
  ```
63
63
 
64
- ### `clean(string: string, placeholder?: string): string`
64
+ ---
65
65
 
66
- Cleans a string by replacing each character of profane words with a placeholder character.
66
+ ### `detect(text: string): ProfanityDetectionResult`
67
67
 
68
- ```javascript
69
- // Default placeholder is "*"
70
- profanity.clean('This contains bullshit.');
71
- // => "This contains ********."
68
+ Returns a detailed result:
72
69
 
73
- // Custom placeholder character
74
- profanity.clean('This contains bullshit.', '#');
75
- // => "This contains ########."
70
+ - `hasProfanity: boolean`
71
+ - `detectedWords: string[]` (actual matched words)
72
+ - `cleanedText: string` (character-masked)
73
+ - `severity: ProfanitySeverity` (`MILD`, `MODERATE`, `SEVERE`, `EXTREME`)
74
+ - `positions: Array<{ word: string, start: number, end: number }>`
75
+
76
+ ```typescript
77
+ const result = profanity.detect('This is fucking bullshit and chutiya.');
78
+ console.log(result.hasProfanity); // true
79
+ console.log(result.detectedWords); // ['fucking', 'bullshit', 'chutiya']
80
+ console.log(result.severity); // 3 (SEVERE)
81
+ console.log(result.cleanedText); // "This is ******* ******** and ******."
82
+ console.log(result.positions); // e.g. [{word: 'fucking', start: 8, end: 15}, ...]
76
83
  ```
77
84
 
78
- ### `cleanWithWord(string: string, placeholder?: string): string`
85
+ ---
79
86
 
80
- Cleans a string by replacing entire profane words with a single placeholder string.
87
+ ### `clean(text: string, placeholder?: string): string`
81
88
 
82
- ```javascript
83
- // Default placeholder is "***"
84
- profanity.cleanWithWord('This contains bullshit.');
85
- // => "This contains ***."
89
+ Replace each character of profane words with a placeholder (default: `*`).
86
90
 
87
- // Custom placeholder string
88
- profanity.cleanWithWord('This contains bullshit.', '[CENSORED]');
89
- // => "This contains [CENSORED]."
91
+ ```typescript
92
+ profanity.clean('This contains bullshit.'); // "This contains ********."
93
+ profanity.clean('This contains bullshit.', '#'); // "This contains ########."
94
+ profanity.clean('यह एक चूतिया परीक्षण है।'); // e.g. "यह एक ***** परीक्षण है।"
90
95
  ```
91
96
 
92
- ### `list(): string[]`
97
+ ---
98
+
99
+ ### `cleanWithPlaceholder(text: string, placeholder?: string): string`
93
100
 
94
- Returns an array of all the profanity words currently in the filter.
101
+ Replace each profane word with a single placeholder (default: `***`).
102
+ (If the placeholder is omitted, uses `***`.)
95
103
 
96
- ```javascript
97
- const words = profanity.list();
98
- console.log(words); // ["fuck", "bullshit", "chutiya", ...]
104
+ ```typescript
105
+ profanity.cleanWithPlaceholder('This contains bullshit.'); // "This contains ***."
106
+ profanity.cleanWithPlaceholder('This contains bullshit.', '[CENSORED]'); // "This contains [CENSORED]."
107
+ profanity.cleanWithPlaceholder('यह एक चूतिया परीक्षण है।', '####'); // e.g. "यह एक #### परीक्षण है।"
99
108
  ```
100
109
 
110
+ ---
111
+
101
112
  ### `add(word: string | string[]): void`
102
113
 
103
- Adds one or more words to the profanity filter.
114
+ Add a word or an array of words to the profanity filter.
104
115
 
105
- ```javascript
106
- // Add a single word
107
- profanity.add('badword');
116
+ ```typescript
117
+ profanity.add('badword123');
118
+ profanity.check('This is badword123.'); // true
108
119
 
109
- // Add multiple words
110
- profanity.add(['badword1', 'badword2', 'बुराशब्द']);
120
+ profanity.add(['mierda', 'puta']);
121
+ profanity.check('Esto es mierda.'); // true (Spanish)
122
+ profanity.check('Qué puta situación.'); // true
111
123
  ```
112
124
 
125
+ ---
126
+
113
127
  ### `remove(word: string | string[]): void`
114
128
 
115
- Removes one or more words from the profanity filter.
129
+ Remove a word or an array of words from the profanity filter.
116
130
 
117
- ```javascript
118
- // Remove a single word
131
+ ```typescript
119
132
  profanity.remove('bullshit');
133
+ profanity.check('This is bullshit.'); // false
120
134
 
121
- // Remove multiple words
122
- profanity.remove(['fuck', 'chutiya']);
135
+ profanity.remove(['mierda', 'puta']);
136
+ profanity.check('Esto es mierda.'); // false
123
137
  ```
124
138
 
125
- ### `clearList(): void`
139
+ ---
126
140
 
127
- Removes all words from the profanity filter, resetting it to an empty list.
141
+ ### `addToWhitelist(words: string[]): void`
128
142
 
129
- ```javascript
130
- profanity.clearList();
143
+ Whitelist words so they are never flagged as profane.
144
+
145
+ ```typescript
146
+ profanity.addToWhitelist(['anal', 'ass']);
147
+ profanity.check('He is an associate professor.'); // false
148
+ profanity.check('I work as an analyst.'); // false
149
+ // Remove from whitelist to restore detection
150
+ profanity.removeFromWhitelist(['anal', 'ass']);
131
151
  ```
132
152
 
153
+ ---
154
+
155
+ ### `removeFromWhitelist(words: string[]): void`
156
+
157
+ Remove words from the whitelist so they can be detected again.
158
+
159
+ ```typescript
160
+ profanity.removeFromWhitelist(['anal']);
161
+ ```
162
+
163
+ ---
164
+
133
165
  ### `setPlaceholder(placeholder: string): void`
134
166
 
135
- Sets the default placeholder character for the `clean` method.
167
+ Set the default placeholder character for `clean()`.
136
168
 
137
- ```javascript
138
- // Set "#" as the default placeholder character
169
+ ```typescript
139
170
  profanity.setPlaceholder('#');
171
+ profanity.clean('This is bullshit.'); // "This is ########."
172
+ profanity.setPlaceholder('*'); // Reset to default
140
173
  ```
141
174
 
142
- ## Word Boundary Detection
175
+ ---
143
176
 
144
- The library is designed to handle word boundaries correctly, reducing false positives:
177
+ ### `updateConfig(options: Partial<AllProfanityOptions>): void`
145
178
 
146
- ```javascript
147
- profanity.check('He is an associate professor.'); // false, even though 'ass' is a profane word
148
- profanity.check('I'm an analyst at this company.'); // false, even though 'anal' is a profane word
149
- profanity.check('This is ass and that's bad.'); // true
150
- ```
179
+ Change configuration at runtime.
180
+ Options include: `enableLeetSpeak`, `caseSensitive`, `strictMode`, `detectPartialWords`, `defaultPlaceholder`, `languages`, `whitelistWords`.
151
181
 
152
- ## Language Support
182
+ ```typescript
183
+ profanity.updateConfig({ caseSensitive: true, enableLeetSpeak: false });
184
+ profanity.check('FUCK'); // false (if caseSensitive)
185
+ profanity.updateConfig({ caseSensitive: false, enableLeetSpeak: true });
186
+ profanity.check('f#ck'); // true
187
+ ```
153
188
 
154
- ### Current Languages
189
+ ---
155
190
 
156
- #### English
191
+ ### `loadLanguage(language: string): boolean`
157
192
 
158
- Built on top of the leo-profanity library, AllProfanity includes comprehensive English profanity detection.
193
+ Load a built-in language.
159
194
 
160
- #### Hindi/Hinglish Support
195
+ ```typescript
196
+ profanity.loadLanguage('french');
197
+ profanity.check('Ce mot est merde.'); // true
198
+ ```
161
199
 
162
- The library comes pre-loaded with an extensive list of Hindi profanities in both Devanagari and Roman scripts, as well as common Hinglish abbreviations and variations.
200
+ ---
163
201
 
164
- ```javascript
165
- // Hindi in Devanagari script
166
- profanity.check('इस वाक्य में लंड शब्द है।'); // true
202
+ ### `loadLanguages(languages: string[]): number`
167
203
 
168
- // Hindi in Roman script
169
- profanity.check('Is vakya mein lund shabd hai.'); // true
204
+ Load multiple built-in languages at once.
170
205
 
171
- // Hinglish abbreviations
172
- profanity.check('Usne bc kaha.'); // true
206
+ ```typescript
207
+ profanity.loadLanguages(['english', 'french', 'german']);
208
+ profanity.check('Das ist scheiße.'); // true (German)
173
209
  ```
174
210
 
175
- #### Indian Languages
211
+ ---
176
212
 
177
- AllProfanity supports multiple Indian languages including Bengali, Tamil, and Telugu in both their native scripts and Roman transliterations.
213
+ ### `loadIndianLanguages(): number`
178
214
 
179
- ```javascript
180
- // Bengali in Bengali script
181
- profanity.check('এই বাক্যে বাল শব্দ আছে।'); // true
215
+ Convenience: Load all major Indian language packs.
182
216
 
183
- // Tamil in Tamil script
184
- profanity.check('இந்த வாக்கியத்தில் கூதி உள்ளது.'); // true
217
+ ```typescript
218
+ profanity.loadIndianLanguages();
219
+ profanity.check('यह एक बेंगाली गाली है।'); // true (Bengali)
220
+ profanity.check('This is a Tamil profanity: புண்டை'); // true
221
+ ```
185
222
 
186
- // Telugu in Telugu script
187
- profanity.check('ఈ వాక్యంలో పూకు పదం ఉంది.'); // true
223
+ ---
188
224
 
189
- // Loading all Indian languages at once
190
- import { AllProfanity } from 'allprofanity';
191
- const filter = new AllProfanity();
192
- filter.loadIndianLanguages(); // Loads Hindi, Bengali, Tamil, and Telugu
193
- ```
225
+ ### `loadCustomDictionary(name: string, words: string[]): void`
194
226
 
195
- #### European Languages
227
+ Add your own dictionary as an additional language.
196
228
 
197
- AllProfanity also supports several European languages including French, German, and Spanish.
229
+ ```typescript
230
+ profanity.loadCustomDictionary('swedish', ['fan', 'jävla', 'skit']);
231
+ profanity.loadLanguage('swedish');
232
+ profanity.check('Det här är skit.'); // true
233
+ ```
198
234
 
199
- ```javascript
200
- // French example
201
- profanity.check('Cette phrase contient le mot merde.'); // true
235
+ ---
202
236
 
203
- // German example
204
- profanity.check('Dieser Satz enthält das Wort scheisse.'); // true
237
+ ### `getLoadedLanguages(): string[]`
205
238
 
206
- // Spanish example
207
- profanity.check('Esta frase contiene la palabra mierda.'); // true
239
+ Returns the names of all currently loaded language packs.
240
+
241
+ ```typescript
242
+ console.log(profanity.getLoadedLanguages()); // ['english', 'hindi', ...]
208
243
  ```
209
244
 
210
- ### Loading Additional Languages
245
+ ---
211
246
 
212
- By default, only English and Hindi are loaded. You can load additional languages as needed:
247
+ ### `getAvailableLanguages(): string[]`
213
248
 
214
- ```javascript
215
- // Load individual languages
216
- profanity.loadLanguage('bengali');
217
- profanity.loadLanguage('tamil');
218
- profanity.loadLanguage('french');
249
+ Returns the names of all available built-in language packs.
219
250
 
220
- // Load multiple languages at once
221
- profanity.loadLanguages(['telugu', 'german', 'spanish']);
251
+ ```typescript
252
+ console.log(profanity.getAvailableLanguages());
253
+ // ['english', 'hindi', 'french', 'german', 'spanish', 'bengali', 'tamil', 'telugu']
254
+ ```
222
255
 
223
- // Get available languages
224
- const availableLanguages = profanity.getAvailableLanguages();
225
- // => ['hindi', 'bengali', 'tamil', 'telugu', 'french', 'german', 'spanish']
256
+ ---
226
257
 
227
- // Get currently loaded languages
228
- const loadedLanguages = profanity.getLoadedLanguages();
229
- // => ['english', 'hindi', ...]
230
- ```
258
+ ### `clearList(): void`
259
+
260
+ Remove all loaded languages and dynamic words (start with a clean filter).
231
261
 
232
- ### Future Language Support
262
+ ```typescript
263
+ profanity.clearList();
264
+ profanity.check('fuck'); // false
265
+ profanity.loadLanguage('english');
266
+ profanity.check('fuck'); // true
267
+ ```
233
268
 
234
- AllProfanity is designed with extensibility in mind. If you'd like to contribute language packs, please see the Contributing section below.
269
+ ---
235
270
 
236
- ## Mixed Language Content
271
+ ### `getConfig(): Partial<AllProfanityOptions>`
237
272
 
238
- AllProfanity effectively handles mixed-language content containing profanities from different languages:
273
+ Get the current configuration.
239
274
 
240
- ```javascript
241
- profanity.check('This English sentence has chutiya which is bad.'); // true
242
- profanity.check('I'm saying मादरचोद and bullshit in one sentence.'); // true
275
+ ```typescript
276
+ console.log(profanity.getConfig());
277
+ /*
278
+ {
279
+ defaultPlaceholder: '*',
280
+ enableLeetSpeak: true,
281
+ caseSensitive: false,
282
+ strictMode: false,
283
+ detectPartialWords: false,
284
+ languages: [...],
285
+ whitelistWords: [...]
286
+ }
287
+ */
243
288
  ```
244
289
 
245
- ## Customizing The Library
290
+ ---
246
291
 
247
- ### Adding Custom Profanity Lists
292
+ ## Severity Levels
248
293
 
249
- You can add your own profanity lists to extend support for other languages or add additional words to existing languages:
294
+ Severity reflects the number and variety of detected profanities:
250
295
 
251
- ```javascript
252
- // Add custom profanity words
253
- profanity.add([
254
- 'customword1',
255
- 'customword2',
256
- 'customword3'
257
- ]);
296
+ | Level | Enum Value | Description |
297
+ |-----------|------------|-----------------------------------------|
298
+ | MILD | 1 | 1 unique/total word |
299
+ | MODERATE | 2 | 2 unique or total words |
300
+ | SEVERE | 3 | 3 unique/total words |
301
+ | EXTREME | 4 | 4+ unique or 5+ total profane words |
258
302
 
259
- // Now it will detect Spanish profanity
260
- profanity.check('Este es un ejemplo de mierda.'); // true
303
+ ---
304
+
305
+ ## Language Support
306
+
307
+ - **Built-in:** English, Hindi, French, German, Spanish, Bengali, Tamil, Telugu
308
+ - **Scripts:** Latin/Roman, Devanagari, Tamil, Telugu, Bengali, etc.
309
+ - **Mixed Content:** Handles mixed-language and code-switched sentences.
310
+
311
+ ```typescript
312
+ profanity.check('This is bullshit and चूतिया.'); // true (mixed English/Hindi)
313
+ profanity.check('Ce mot est merde and पागल.'); // true (French/Hindi)
261
314
  ```
262
315
 
263
- ### Creating a Custom-Configured Instance
316
+ ---
264
317
 
265
- If you need multiple differently-configured instances of the filter, you can import the AllProfanity class directly:
318
+ ## Use Exported Wordlists
266
319
 
267
- ```javascript
268
- import { AllProfanity } from 'allprofanity';
320
+ For sample words in a language (for UIs, admin, etc):
269
321
 
270
- // Create custom instances
271
- const kidSafeFilter = new AllProfanity({ includeModerate: true });
272
- const adultFilter = new AllProfanity({ includeModerate: false });
322
+ ```typescript
323
+ import { englishBadWords, hindiBadWords } from 'allprofanity';
324
+ console.log(englishBadWords.slice(0, 5)); // ["fuck", "shit", ...]
273
325
  ```
274
326
 
275
- ## Advanced Use Cases
327
+ ---
276
328
 
277
- ### Performance Optimization
329
+ ## Security
278
330
 
279
- For applications processing large volumes of text:
331
+ - **No wordlist exposure:** There is no `.list()` function for security and encapsulation. Use exported word arrays for samples.
332
+ - **TRIE-based:** Scales easily to 50,000+ words.
333
+ - **Handles leet-speak:** Catches obfuscated variants like `f#ck`, `a55hole`.
280
334
 
281
- ```javascript
282
- // Pre-compile your most used strings for faster checking
283
- const badWordsList = profanity.list();
284
- const preCompiledRegex = new RegExp('\\b(' + badWordsList.join('|') + ')\\b', 'i');
335
+ ---
285
336
 
286
- function quickCheck(text) {
287
- return preCompiledRegex.test(text);
288
- }
289
- ```
337
+ ## Full Example
290
338
 
291
- ### Content Moderation Systems
292
-
293
- ```javascript
294
- function moderateContent(content) {
295
- if (profanity.check(content)) {
296
- return {
297
- isApproved: false,
298
- cleanedContent: profanity.cleanWithWord(content, '[INAPPROPRIATE]'),
299
- reason: 'Contains profanity'
300
- };
301
- }
302
- return { isApproved: true, cleanedContent: content };
303
- }
304
- ```
339
+ ```typescript
340
+ import profanity, { ProfanitySeverity } from 'allprofanity';
305
341
 
306
- ## Use Cases
342
+ // Multi-language detection
343
+ profanity.loadLanguages(['english', 'french', 'tamil']);
344
+ console.log(profanity.check('Ce mot est merde.')); // true
307
345
 
308
- - Content moderation systems
309
- - Chat applications
310
- - User-generated content platforms
311
- - Educational software
312
- - Forums and community platforms
313
- - Social media content filtering
314
- - Comment sections
315
- - Gaming chat filters
316
- - Email filtering
317
- - Document processing systems
346
+ // Leet-speak detection
347
+ console.log(profanity.check('You a f#cking a55hole!')); // true
318
348
 
319
- ## Browser Support
349
+ // Whitelisting
350
+ profanity.addToWhitelist(['anal', 'ass']);
351
+ console.log(profanity.check('He is an associate professor.')); // false
320
352
 
321
- AllProfanity works in all modern browsers and Node.js environments.
353
+ // Severity
354
+ const result = profanity.detect('This is fucking bullshit and chutiya.');
355
+ console.log(ProfanitySeverity[result.severity]); // "SEVERE"
322
356
 
323
- ## Roadmap
357
+ // Custom dictionary
358
+ profanity.loadCustomDictionary('pirate', ['barnacle-head', 'landlubber']);
359
+ profanity.loadLanguage('pirate');
360
+ console.log(profanity.check('You barnacle-head!')); // true
324
361
 
325
- - Add support for more languages (Spanish, French, German, Arabic, etc.)
326
- - Contextual profanity detection
327
- - Severity levels for different categories of profanity
328
- - Phonetic matching for evasion attempts
329
- - Plugin system for custom detection strategies
362
+ // Placeholder configuration
363
+ profanity.setPlaceholder('#');
364
+ console.log(profanity.clean('This is bullshit.')); // "This is ########."
365
+ profanity.setPlaceholder('*'); // Reset
366
+ ```
330
367
 
331
- ## License
368
+ ---
332
369
 
333
- This project is licensed under the MIT License - see the [LICENSE](https://github.com/ayush-jadaun/allprofanity/blob/main/LICENSE) file for details.
370
+ ## FAQ
334
371
 
335
- ## Contributing
372
+ **Q: How do I see all loaded profanities?**
373
+ A: For security, the internal word list is not exposed. Use `englishBadWords` etc. for samples.
374
+
375
+ **Q: How do I reset the filter?**
376
+ A: Use `clearList()` and reload languages/dictionaries.
336
377
 
337
- Contributions are welcome! Whether it's adding new language support, improving detection algorithms, or enhancing documentation.
378
+ **Q: Is this safe for browser and Node.js?**
379
+ A: Yes! AllProfanity is universal.
338
380
 
339
- Please feel free to submit a Pull Request or open an Issue on GitHub.
381
+ ---
340
382
 
341
- ### Adding a New Language
383
+ ## Roadmap
342
384
 
343
- To add support for a new language:
385
+ - More language packs (Arabic, Russian, etc.)
386
+ - Contextual detection & severity scoring
387
+ - Phonetic/typo/obfuscation resilience
388
+ - Plugin system for custom detection
344
389
 
345
- 1. Create a new file in the `src/languages` directory (e.g., `french-words.ts`)
346
- 2. Follow the format of the existing word lists
347
- 3. Submit a pull request with your changes
390
+ ---
348
391
 
349
- ## Acknowledgements
392
+ ## License
350
393
 
351
- - Built on top of [leo-profanity](https://github.com/jojoee/leo-profanity)
394
+ MIT See [LICENSE](https://github.com/ayush-jadaun/allprofanity/blob/main/LICENSE)
395
+
396
+ ---
397
+
398
+ ## Contributing
352
399
 
400
+ We welcome new language packs, detection improvements, and docs!
401
+ To add a new language, create a file in `src/languages/` and export a string array.
402
+ Open a PR or issue for bugs, features, or suggestions.