@badwords/languages
v3.0.0
Published
Optional language word lists for badwords-wasm
Maintainers
Readme
@badwords/languages
Optional language word lists for badwords-wasm, which ships with English and Russian built in.
Usage
npm install badwords-wasm @badwords/languagesimport init, { ProfanityFilter } from 'badwords-wasm';
import de from '@badwords/languages/de';
import uk from '@badwords/languages/uk';
await init();
const filter = new ProfanityFilter();
filter.addWords(de);
filter.addWords(uk);
filter.isProfane('some text');TypeScript declarations are included; each import is typed as string[].
Languages
| Code | Language | Entries |
|------|----------|---------|
| cs | Czech | 217 |
| da | Danish | 207 |
| de | German | 248 |
| el | Greek | 591 |
| en | English | 796 |
| es | Spanish | 584 |
| es_419 | Spanish (Latin America) | 184 |
| fi | Finnish | 303 |
| fr | French | 295 |
| hu | Hungarian | 286 |
| id | Indonesian | 236 |
| it | Italian | 409 |
| ja | Japanese | 290 |
| ko | Korean | 341 |
| nl | Dutch | 342 |
| no | Norwegian | 92 |
| pl | Polish | 6974 |
| pt | Portuguese | 271 |
| pt_br | Portuguese (Brazil) | 121 |
| ro | Romanian | 145 |
| ru | Russian | 3905 |
| sv | Swedish | 181 |
| th | Thai | 172 |
| tr | Turkish | 1031 |
| uk | Ukrainian | 2109 |
Legacy codes
The codes used before 3.0.0 still resolve to the same word lists. The four below are kept only for compatibility - each one is the ISO 639-1 code of a different language, so prefer the canonical code.
| Code | Resolves to | Note |
|------|-------------|------|
| br | pt_br | br is ISO 639-1 for Breton; this list is Brazilian Portuguese. Use pt_br. |
| cz | cs | |
| du | nl | |
| gr | el | |
| in | id | in is a retired ISO 639-1 code for Indonesian. Use id. |
| lt | es_419 | lt is ISO 639-1 for Lithuanian; this list is Latin-American Spanish. Use es_419. |
| po | pt | |
| sp | es | |
| sw | sv | sw is ISO 639-1 for Swahili; this list is Swedish. Use sv. |
| tu | tr | |
| ua | uk | |
Generated by make lang-packages.
