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 2 years, 11 months ago
  2. CleanCharField by DvD 4 years, 4 months ago
  3. Internet Explorer Redirect Decorator by johnboxall 3 years, 3 months ago
  4. pavement file for deploying django projects by bl4th3rsk1t3 2 years, 8 months ago
  5. Profanity Check by menendez 2 years, 6 months ago

Comments

(Forgotten your password?)