Beispiel #1
0
 def __init__(self, parser):
     self.ROOT_PREFIX = parser.get('app_config', 'confdir')
     self.category = "Banned Phrase"
     self.config_file = self.ROOT_PREFIX + "/lists/bannedphraselist"
     self.wordMap = WordMap()
     strings = loadFile(self.config_file)
     for string in strings:
         phrase = Phrase()
         phrase.addPhrase(string)
         self.wordMap.add(phrase)
     self.wordMap.sort()
     self.handler = "blockpage"
     # Stop as soon as a match is found
     self.stop_after_match = True
     # Scan each chunk individually
     self.scan_chunks = True
Beispiel #2
0
 def __init__(self, parser):
     self.ROOT_PREFIX = parser.get('app_config', 'confdir')
     self.category = "Banned Phrase"
     self.config_file = self.ROOT_PREFIX + "/lists/bannedphraselist"
     self.wordMap = WordMap()
     strings = loadFile(self.config_file)
     for string in strings:
         phrase = Phrase()
         phrase.addPhrase(string)
         self.wordMap.add(phrase)
     self.wordMap.sort()
     self.handler = "blockpage"
     # Stop as soon as a match is found
     self.stop_after_match = True
     # Scan each chunk individually
     self.scan_chunks = True
Beispiel #3
0
 def __init__(self, parser):
     self.ROOT_PREFIX = parser.get('app_config', 'confdir')
     self.category = "Exception Phrase"
     self.config_file = self.ROOT_PREFIX + "/lists/exceptionphraselist"
     self.phrase_list = {}
     strings = loadFile(self.config_file)
     for string in strings:
         phrase = Phrase()
         phrase.addPhrase(string)
         phrase_key = phrase.getKey()
         for char in phrase_key:
             if not char in self.phrase_list:
                 self.phrase_list[char] = []
             self.phrase_list[char].append(phrase)
     self.handler = "noop"
     # Stop as soon as a match is found
     self.stop_after_match = True
     # Scan each chunk individually
     self.scan_chunks = True
Beispiel #4
0
 def __init__(self, parser):
     self.ROOT_PREFIX = parser.get('app_config', 'confdir')
     self.category = "Exception Phrase"
     self.config_file = self.ROOT_PREFIX + "/lists/exceptionphraselist"
     self.phrase_list = {}
     strings = loadFile(self.config_file)
     for string in strings:
         phrase = Phrase()
         phrase.addPhrase(string)
         phrase_key = phrase.getKey()
         for char in phrase_key:
             if not char in self.phrase_list:
                 self.phrase_list[char] = []
             self.phrase_list[char].append(phrase)
     self.handler = "noop"
     # Stop as soon as a match is found
     self.stop_after_match = True
     # Scan each chunk individually
     self.scan_chunks = True