profanity | A Python library to check for profanity

 by   ben174 Python Version: 1.1 License: GPL-2.0

kandi X-RAY | profanity Summary

kandi X-RAY | profanity Summary

profanity is a Python library. profanity has no bugs, it has no vulnerabilities, it has build file available, it has a Strong Copyleft License and it has high support. You can install using 'pip install profanity' or download it from GitHub, PyPI.

A Python library to check for (and clean) profanity in strings. ![Q-Bert spitting some profanity][logo] [logo]: ##Installation pip install profanity. ##Usage from profanity import profanity profanity.contains_profanity("You smell like shit.") Out: True.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              profanity has a highly active ecosystem.
              It has 48 star(s) with 21 fork(s). There are 5 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 3 open issues and 0 have been closed. On average issues are closed in 1043 days. There are 3 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of profanity is 1.1

            kandi-Quality Quality

              profanity has 0 bugs and 0 code smells.

            kandi-Security Security

              profanity has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              profanity code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              profanity is licensed under the GPL-2.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              profanity releases are not available. You will need to build from source code and install.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              profanity saves you 49 person hours of effort in developing the same functionality from scratch.
              It has 130 lines of code, 12 functions and 5 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed profanity and discovered the below as its top functions. This is intended to give you an instant insight into profanity implemented functionality, and help decide if they suit your requirements.
            • Checks if the input text contains profanity
            • Load the wordlist
            • Cleans the input text
            • Get a random censor character
            • Get the list of words
            • Get the data directory for the given path
            Get all kandi verified functions for this library.

            profanity Key Features

            No Key Features are available at this moment for profanity.

            profanity Examples and Code Snippets

            No Code Snippets are available at this moment for profanity.

            Community Discussions

            QUESTION

            Async function needed somewhere
            Asked 2022-Feb-02 at 12:11

            I'm coding a Discord js V12 bot, specifically the image command. Since I simply use the NPM package images-scraper, you can also look up NSFW images. So, what I am doing now, is adding a profanity filter. This is my code now:

            ...

            ANSWER

            Answered 2022-Feb-02 at 12:11

            You can't call an async function inside a forEach loop in that way, you could change it to a normal for ... of loop and put it inside a async function, you can only call a async function with await if you are already inside a async function.

            I tried to write the code bellow

            Source https://stackoverflow.com/questions/70852019

            QUESTION

            Profanity list detection Discord.js V12
            Asked 2022-Jan-25 at 10:02

            I have an image command for my bot. This is used for memes and other funny pictures. My bot just scrapes Google for the best result. But on the other side, you can also look up, well, NSWF images. Since I don't want people sending those, I am trying to build a profanity filter. It now works like this:

            ...

            ANSWER

            Answered 2022-Jan-25 at 10:02

            It doesn't work because you have a mistake in the "if" part (if something end). And actually the "if" doesn't work and it executes the next functions for each word in the array.

            Maybe something like this:

            Source https://stackoverflow.com/questions/70845730

            QUESTION

            Javascript array in external file?
            Asked 2022-Jan-21 at 16:03

            I have a large profanity list, as an array. Since this list is so big, I don't want it in my main file, but externally. I want something like this:

            const blacklist = require(./blacklist.js)

            And currently it is something like this:

            ...

            ANSWER

            Answered 2022-Jan-21 at 16:03

            Discord.js is based on NodeJS, so:

            blacklist.js :

            Source https://stackoverflow.com/questions/70804030

            QUESTION

            How to compare two arrays of strings, find all matches, when there might be a sentence?
            Asked 2022-Jan-06 at 03:54

            This is a fun one - I am building a profanity checker!

            For the purposes of this exercise, let's have an array of forbidden words, like so:

            const forbiddenWords = ['apples', 'oranges', 'blue carrots', 'mushy green peas'];

            Then I will have an input field for a user to input the something. It could be an infinite combo of words, but I would like to find ALL instances of the forbidden words and return them as an array. I've thought of this function, which gets me really close:

            ...

            ANSWER

            Answered 2022-Jan-06 at 03:26

            You're probably best off creating a regular expression. This way, you can skip the next to split and ignore capitalization issues

            You can do this like

            Source https://stackoverflow.com/questions/70602048

            QUESTION

            Angular-cli: TypeError: core.resolve is not a function
            Asked 2021-Dec-20 at 10:44

            I have a pre-developed angular project, i just ran npm i to install its packages locally, then ng serve to run the project, the project works well without problems but..

            when i wanted to create a new component with ng g c new-component i got this error:

            ...

            ANSWER

            Answered 2021-Dec-20 at 10:44

            following @Batajus's response about compatibility, i could fix this problem with these steps:

            1. Delete node_module folder
            2. Delete package-lock.json
            3. Run npm i
            4. finally npm i -D @angular-devkit/core@0.3.2 (angular-devkit/core should be 0.3.2 for Angular V5)

            Source https://stackoverflow.com/questions/70420139

            QUESTION

            Profanity filter could not load Spacy model 'en'
            Asked 2021-Nov-01 at 04:47

            I need the Spacy model 'en' for the Python profanity-filter. I would like to have a requirements.txt file that installs everything needed. I have the following:

            ...

            ANSWER

            Answered 2021-Nov-01 at 04:47

            You can't fix this in requirements.txt. Making the shortcut en work for the model en_core_web_sm isn't a property of the installed package, it's something spaCy manages separately. The shortcut process relies on symbolic links and is kind of flaky, which is why it was removed in v3.

            Since it looks like the profanity filter package is abandoned, your options are running spacy link from the command line or modifying the profanity filter package yourself.

            You could also figure out what spacy link is doing and do that (or call the relevant functions) in code.

            Source https://stackoverflow.com/questions/69791122

            QUESTION

            Django Find Hashtags in String and Replace It by Wrapping It in Tag
            Asked 2021-Sep-16 at 16:29

            I am making a social media site, and I want to enable hashtags. For example, if a user creates a post like this:

            ...

            ANSWER

            Answered 2021-Sep-16 at 16:29

            To replace hashtags (of the form: "#categoryname") with the url of the related category:

            Source https://stackoverflow.com/questions/69074897

            QUESTION

            How to add exception for bad word in regular expression for profanity?
            Asked 2021-Aug-25 at 22:03

            I use Python regular expression to do the profanity check. I have a blocked list of words, but there are some corner cases where I want to add exceptions for the bad words.

            For example, I have ['foo', 'bar'] in the blocked list. But I want to exempt cases when it is:

            1. "BAR"
            2. "foo good"

            This is my current approach in Python:

            ...

            ANSWER

            Answered 2021-Aug-25 at 19:08

            QUESTION

            Discord bot repeating the command but not an event in discord.py
            Asked 2021-Aug-22 at 03:46

            I want to ask something.I got stuck on something.I wanted to add some new features to my bot such as swear words so that making cleaner server.I finished my code and tried to give command which is !dc greetings(!dc is my command_prefix btw).My bot sent 'Hi everyone' message for 7 times.That 7 times is same number as the number of swear words in "Badwords.txt".By looking these,that repeating issue is related to this file handling codes(or not idk).Interesting thins is when I write swear word into server's chatbox,bot send only one "Please do not use this word ever" message.So How can i prevent bot not to repeat for many times?Thank you

            ...

            ANSWER

            Answered 2021-Aug-22 at 03:46

            I would take the await client.process_commands(message) out of the else statement. I have also moved the with open inside the on message event so everything a message is sent, it will open the file to check if the message contained a bad word.

            Source https://stackoverflow.com/questions/68875995

            QUESTION

            Audio profanity filter using python
            Asked 2021-Aug-21 at 13:15

            I am trying to write a python code in which users inputs a video file and program will mute/beep the curse/bad words in it and outputs a filtered video file, basically a profanity filter. Firstly, I converted the video file into .wav format and then trying to apply audio profanity filter into the .wav file and will write that .wav file into the video.

            So far, I am able to make chunks of audio file and extract text from each audio chunk of 5 secs using speech_recognition library. But, if words are overlapped between the chunks I will not be able to detect detect them and apply the check condition if that chunk text is found in curse words list and will reduce the db of that audio file which will mute it (Suggest other way to make beep sound instead of muting it).

            I am confused if my approach is right. I just want a audio profanity filter using python, up-till now I am able to extract text and make chunks only.

            ...

            ANSWER

            Answered 2021-Aug-21 at 13:15

            First extract audio.wav from the video file. Then using this solution get the timestamps for each word from that audio. You can then mute/beep the bad words from the audio and join it back to the video.

            Source https://stackoverflow.com/questions/68812092

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            An incorrect implementation of "XEP-0280: Message Carbons" in multiple XMPP clients allows a remote attacker to impersonate any user, including contacts, in the vulnerable application's display. This allows for various kinds of social engineering attacks. This CVE is for profanity (0.4.7 - 0.5.0).

            Install profanity

            You can install using 'pip install profanity' or download it from GitHub, PyPI.
            You can use profanity like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            I wrote this to satisfy my needs. Please feel free to contribute if you have other needs that you think others would benefit from!. Feel free to contact me: http://www.bugben.com.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install profanity

          • CLONE
          • HTTPS

            https://github.com/ben174/profanity.git

          • CLI

            gh repo clone ben174/profanity

          • sshUrl

            git@github.com:ben174/profanity.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link