~johanvandegriff/games.johanv.xyz

ref: 0fe1d6697297df58ba410e6e807e0ca6a0499db1 games.johanv.xyz/profanity_test.py -rw-r--r-- 645 bytes
0fe1d669Johan Vandegriff changed method of merging immutabledicts to work in python3.8 1 year, 7 days 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)