bdw (Bad Word Filter)
bdw (Bad Word Filter) is a Python library designed to filter text and detect obscene words in several languages (en, pl, de, ru, ua). It allows you to determine whether the text contains obscene words depending on the selected language or in several languages at the same time.
Installation
You can install bdw using pip:
pip install git+https://github.com/FlacSy/bdw.git
Examples
Example of using bdw (Like check example):
from bdw.check import Check
# Use only Russian language
filter_ru = Check(languages=['ru'])
# Use all available languages
filter_all = Check(all=True)
# Use multiple languages
filter_multiple_languages = Check(languages=['ru', 'en', 'de'])
# Checking the text for obscene words in a specific language
text = input('Word check: ')
if filter_ru.filter_profanity(text, language='ru'):
print("The text contains obscene words in Russian")
# Checking text for obscene words in all languages
if filter_all.filter_profanity(text):
print("The text contains obscene words in one of the available languages")
Example of using bdw - delete:
from bdw.delete import Delete
filter = Delete(languages=['ru']) # Specify supported languages
text = input('Word check: ')
filtered_text = filter.filter_profanity(text, language='ru')
print(filtered_text)
Example of using bdw - replace:
from bdw.replace import Replace
filter = Replace()
text = input('Word check: ')
filtered_text = filter.filter_profanity(text, language='ru', replacement_text='***')
print(filtered_text)
Example of using bdw - loader:
from bdw.loader import WordsLoader
loader = WordsLoader()
loader.load_file('you_dir/file_name.txt')
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Links
Metadata
Release files for bdw 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bdw-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / bdw-1.1.1-py3-none-any.whl
| Download URL | bdw-1.1.1-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56a6611d0877618ce535cb42f0aa2f25e32f0cce10783712c07d29e8d5047495
|
|
BLAKE2b-256 checksum How to use checksums |
294ddef3da732f01c3ae51698449b993e0bf6c8222ae7c8a75bf9d1223d697a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.0
|
Security for bdw 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.