ProximityFilter

class squirro.lib.nlp.steps.filters.ProximityFilter(config)

Bases: squirro.lib.nlp.steps.filters.RegexFilter

Filters documents by checking if terms exist within a specified proximity

Format for proximity search is e.g. “issue shares~6”. To make the search one directional append “|”, e.g. “issue shares~6|”. It is possible to use more than 2 terms where the distance is used between consecutive terms, or use a single exact match term without proximity distance.

Expressions are case insensitive.

Parameters
  • type (str) – proximity

  • blacklist_terms (list, []) – List of blacklist proximity terms

  • whitelist_terms (list, []) – List of whitelist proximity terms

Attributes Summary

REG_FLAGS

Attributes Documentation

REG_FLAGS = 2