Profanity Function (Disemvowel)

1
2
3
4
5
6
7
8
from django.conf import settings
import re

def disemvowel_profanity(value):
    for w in settings.PROFANITIES_LIST:
       if value.find(w)!=-1:
           value = value.replace(value, re.sub(r'[AEIOUYaeiouy]', '', value))
    return value

More like this

  1. Profanity Filter Middleware by areich 4 years, 3 months ago
  2. fancy_if by Scanner 6 years, 1 month ago
  3. Filter; Capitalise Sentences (capsentence) by djm 4 years, 3 months ago
  4. txt2img tag to show on the web text as images by br0th3r 1 year ago
  5. a template tag to invoke a method on an object with a variable by Scanner 6 years ago

Comments

(Forgotten your password?)