本文整理汇总了Python中filter.Filter.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Filter.__init__方法的具体用法?Python Filter.__init__怎么用?Python Filter.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类filter.Filter
的用法示例。
在下文中一共展示了Filter.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from filter import Filter [as 别名]
# 或者: from filter.Filter import __init__ [as 别名]
def __init__(self, jail):
Filter.__init__(self, jail)
self.__modified = False
self.__lastModTime = dict()
self.__file404Cnt = dict()
logSys.info("Created FilterPoll")
示例2: __init__
# 需要导入模块: from filter import Filter [as 别名]
# 或者: from filter.Filter import __init__ [as 别名]
def __init__(self, **options):
Filter.__init__(self, **options)
self.predicates = self.predicates or self.build_predicate_list()
if len(self.predicates) == 0:
raise NotImplementedError("Must provide at least one predicate")
self.normalize_predicates()
self.normalize_counted_features()
self.setup_counts()
示例3: __init__
# 需要导入模块: from filter import Filter [as 别名]
# 或者: from filter.Filter import __init__ [as 别名]
def __init__(self):
Filter.__init__(self)
self._name = "Outlier"
self._input = None
self._dimensions = None
self._output = None
# cutoff: we compare the neighborhood average to the current datum; if the
# datum is in the 95th (or higher) percentile, it is considered an outlier.
self.set_parameter_floatrange("cutoff", 0.95, 0.0,1.0)
# if the averaging out is inclusive of the datum in question
self.set_parameter("inclusive", False, bool)
示例4: __init__
# 需要导入模块: from filter import Filter [as 别名]
# 或者: from filter.Filter import __init__ [as 别名]
def __init__(self, lemmas=None, fields=['lemma'], word_limit=None,
predicate=None):
'''
lemmas : None | iterable
Only count lemmas that are in this list. If None, count all lemmas.
fields : iterable
Field combination to count. By default count lemmas; e.g.
fields=['lemma', 'pos'] will count noun and verb occurrences of the
same lemma separately.
word_limit : None | int
Stop after this number of words have been processed.
predicate : None | callable
If not None, lemmas are only counted if this function return True
(when passed the whole word). E.g., `lambda x: x['pos'] == 'noun'`
would only count nouns.
'''
Filter.__init__(self)
self.lemmas = None if lemmas is None else list(lemmas)
self.counter = collections.Counter()
self.word_limit = word_limit
self.predicate = predicate
self.total_word_count = 0
self.sentence_count = 0
self.fields = list(fields)
示例5: __init__
# 需要导入模块: from filter import Filter [as 别名]
# 或者: from filter.Filter import __init__ [as 别名]
def __init__(self, interesting_verbs, max_tokens=2000, **options):
Filter.__init__(self, **options)
self.dict = {}
self.counters = {}
self.max_tokens = max_tokens
self.interesting_verbs = interesting_verbs