优化敏感字查询
This commit is contained in:
parent
9685db79be
commit
78a8114871
@ -43,6 +43,7 @@ class TextFilter(object):
|
||||
|
||||
# Singleton
|
||||
_instance = None
|
||||
root = None
|
||||
|
||||
def __new__(cls, *args, **kw):
|
||||
"""单例模式"""
|
||||
@ -51,6 +52,7 @@ class TextFilter(object):
|
||||
return cls._instance
|
||||
|
||||
def __init__(self):
|
||||
if self.root == None:
|
||||
self.root = Node()
|
||||
self.sensitive_word = SensitiveWords().sensitive_word_dict
|
||||
for word_type in self.sensitive_word.keys():
|
||||
|
Loading…
x
Reference in New Issue
Block a user