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. NonceField for disabling autocompletion by johnnoone 3 years, 3 months ago
  2. CleanCharField by DvD 4 years, 8 months ago
  3. SMTPConnection with Return-Path by sgb 4 years ago
  4. pavement file for deploying django projects by bl4th3rsk1t3 3 years ago
  5. Internet Explorer Redirect Decorator by johnboxall 3 years, 7 months ago

Comments

(Forgotten your password?)