Metadata-Version: 2.4
Name: anti-profanity
Version: 0.2.5
Summary: A multilingual profanity filter supporting English, Hindi, and Bengali
Home-page: https://github.com/MeeRazi/anti-profanity
Author: MeeRazi
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Processing :: Filters
Classifier: Natural Language :: English
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python
Dynamic: summary

# ProfanityFilter

A simple and customizable profanity filtering class supporting multiple languages: English (`en`), Hindi (`hi`), and Bengali (`bn`). It allows you to **censor**, **detect**, or **remove** profane words from a given text.

## Features

- 🔍 Detect profanity in text  
- ✂️ Remove profanity completely  
- ✳️ Censor profanity with a customizable replacement character  
- 🌐 Multilingual support (English, Hindi, Bengali)  
- 💡 Easy to integrate and extend  

---

## Installation
```bash
pip3 install anti-profanity
```

```python
from anti_profanity import ProfanityFilter

# For Hindi only
pf_hi = ProfanityFilter("hi")

# For English and Hindi
pf_multi = ProfanityFilter(["en", "hi"])

# Add a custom language
pf.add_language("fr", ["merde", "putain"])

# if no argument provided "en' will be default
pf = ProfanityFilter()
```
## Methods

### Usage
```python
#Replaces each character of any detected profanity with the replacement character.
censored = pf.censor_profanity("This text contains shit.")
print(censored)  # Output: This text contains ****

# Checks whether the given text contains any profane words.
is_dirty = pf.is_profanity("This text contain Shit")
print(is_dirty)  # Output: True


# Removes all profane words from the given text.
cleaned = pf.remove_profanity("Some fucking text")
print(cleaned)  # Output: Some  text

# List avilable language
print(pf.list_languages())

# Show available methods
print(pf.list_methods())
```

### Command Line
```bash
# Censor profanity in text
anti_profanity.cli --action censor --text "Your text here" --lang en

# Check if a file contains profanity
anti_profanity.cli --action check --file input.txt --lang en hi

# Remove profanity from a file and save to another file
anti_profanity.cli --action remove --file input.txt --output clean.txt --lang bn

# List supported languages
anti_profanity.cli --action list_langs

# List available methods
anti_profanity.cli --action list_methods
```

## Customization
You can extend the filter by adding your own languages or editing the existing profanity lists in the `data` subdirectory:
Each language file (e.g., `english_en.py`) should export a list of profane words:


## License

[MIT](https://choosealicense.com/licenses/mit/)

