~johanvandegriff/games.johanv.xyz

ref: 5621ee6f39cdfcd3aef162e776888df2cbc14c8a games.johanv.xyz/profanity_test.py -rw-r--r-- 645 bytes
5621ee6f — dependabot[bot] Bump jinja2 from 2.10.1 to 2.11.3 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python

def test():
    from profanity_filter import ProfanityFilter
    pf = ProfanityFilter()
    return pf.censor("That's bullshit!")

def test2(channel):
    import time
    start = time.time()
    from profanity_filter import ProfanityFilter
    pf = ProfanityFilter()
    end = time.time()
    #import json
    #j = json.load(open("/srv/CARL/channels/"+channel+".json",'r'))
    #s = ""
    #n = 0
    #for phrase in j["phrases"]:
        #clean = pf.is_clean(phrase)
        #s += str(clean) + " " + phrase + "<br/>\n"
        #if not clean: n += 1
    #return s + str(n) + "<br/>\n" + str(end-start)
    return str(end-start)