Rule-based profanity checking tool for English and Turkish.
Project description
safetext
Rule-based profanity checking tool for English and Turkish.
installation
pip install safetext
usage
from safetext import SafeText
st = SafeText(language='en')
results = st.check_profanity(text='Some text with <profanity-word>.')
results
>> {'word': '<profanity-word>', 'index': 4, 'start': 15, 'end': 31}
text = st.censor_profanity(text='Some text with <profanity-word>.')
text
>> "Some text with ***."
automated language detection
- automatically set language from text:
from safetext import SafeText
eng_text = "This story is about to take a dark turn."
st = SafeText(language=None)
st.set_language_from_text(eng_text)
st.language
>> 'en'
- automatically set language from .srt (subtitle) file:
from safetext import SafeText
turkish_srt_file_path = "turkish.srt"
st = SafeText(language=None)
st.set_language_from_srt(turkish_srt_file_path)
st.language
>> 'tr'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
safetext-0.0.4.tar.gz
(12.0 kB
view hashes)
Built Distribution
safetext-0.0.4-py3-none-any.whl
(10.8 kB
view hashes)