当前位置: 首页>>代码示例>>Python>>正文


Python Filter.__init__方法代码示例

本文整理汇总了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")
开发者ID:,项目名称:,代码行数:9,代码来源:

示例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()
开发者ID:TalLinzen,项目名称:hebrew-blog-corpus,代码行数:10,代码来源:parsing_filter.py

示例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)
开发者ID:tfogal,项目名称:bub,代码行数:13,代码来源:outlier.py

示例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)
开发者ID:TalLinzen,项目名称:hebrew-blog-corpus,代码行数:26,代码来源:count_lemmas.py

示例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
开发者ID:TalLinzen,项目名称:hebrew-blog-corpus,代码行数:8,代码来源:subcat.py


注:本文中的filter.Filter.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。