Metadata-Version: 2.1
Name: dictionary-profanity-filter
Version: 1.0.4
Summary: Python profanity filter
Home-page: https://github.com/ProgrammingLanguageLeader/dictionary-profanity-filter
Author: Dmitry Shorokhov
Author-email: vip.shoroch@gmail.com
License: MIT license
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
Requires-Dist: DAWG-Python (==0.7.2)
Requires-Dist: alphabet-detector (==0.0.7)
Requires-Dist: docopt (==0.6.2)
Requires-Dist: inflection (==0.3.1)
Requires-Dist: pymorphy2-dicts (==2.4.393442.3710985)
Requires-Dist: pymorphy2 (==0.8)

# Dictionary Profanity Filter

[![Build Status](https://travis-ci.com/ProgrammingLanguageLeader/dictionary-profanity-filter.svg?token=NAXdZ3urs2rzWv4x9zhq&branch=master)](https://travis-ci.com/ProgrammingLanguageLeader/dictionary-profanity-filter)
[![PyPI version](https://badge.fury.io/py/dictionary-profanity-filter.svg)](https://badge.fury.io/py/dictionary-profanity-filter)

Python module for profanity filtering using dictionaries. 
It supports English and Russian languages out-of-the-box.

## Requirements
- Python 3.5 or higher

## How to install
Use the following command to install the package using pip:
```bash
pip install dictionary-profanity-filter
```

## How to use
Here are several examples of the module usage:

- Creating ProfanityFilter instance:

```python
from dictionary_profanity_filter import ProfanityFilter
profanity_filter = ProfanityFilter()
```

- Adding custom words to censor:

```python
profanity_filter.add_words(['censorship', 'blocking'])
profanity_filter.censor('I hate censorship and blocking!')
# Output: 'I hate ********** and ********!'
```

- Detect bad words in the text:

```python
profanity_filter.is_clean('Porn is a restricted word')
# Output: False
```

- Removing word from custom dictionary:

```python
profanity_filter.remove_word('blocking')
profanity_filter.censor('I hate censorship and blocking!')
# Output: 'I hate ********** and blocking!'
```

## TODO
- [ ] Write documentation
- [x] Write tests

