Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 426c726

Browse files
Merge pull request avinashkranjan#680 from jeelnathani/master
issue avinashkranjan#636 @censor_word_detection
2 parents cae89d8 + 4b3d3ad commit 426c726

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

‎Censor word detection/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<h1>Censor Word Detection</h1>
2+
3+
<p>
4+
In this Censor Word Detection python project, we are going to build an application which can detect censor words. Censor words are swear words/abusive words/curse words/bad words in any language. For example: shit. In this application we will detect the Censor words from English language.
5+
</p>
6+
7+
8+
<h3>Requirements</h3>
9+
<ul>
10+
<li>Run the command:
11+
pip install better_profanity</li>
12+
</ul>
13+
14+
<h3> Approach </h3>
15+
<ol>
16+
<li>Import the module profanity from better_profanity</li>
17+
<li>Take user input </li>
18+
<li>Check for the censored data using method profanity.censor() </li>
19+
<li>Print the output on terminal.
20+
<ul>
21+
<li>It will print #### if censor word is detected. Otherwise, it will print the input text you have entered</li>
22+
</ul>
23+
</li>
24+
</ol>
25+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from better_profanity import profanity
2+
3+
def detect(data):
4+
try:
5+
output=profanity.censor(data,'#')
6+
print(output)
7+
except Exception as e:
8+
print(e)
9+
10+
profanity.load_censor_words()
11+
data = input("enter your msg:")
12+
detect(data)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /