default_registry#

scikitplot.cleanprompt.default_registry(kinds=None, literal_terms=None, literal_kind='CUSTOM', word_boundary=False, ignore_case=False)[source]#

Build a registry from the pattern library, plus optional literal terms.

Parameters:
kindsiterable of str, optional

Pattern kinds to include. None selects default_patterns.

literal_termsiterable of str, optional

Exact strings to hide, added as a LiteralDetector.

literal_kindstr, default=’CUSTOM’

Category for the literal detector.

word_boundarybool, default=False

Passed to the literal detector.

ignore_casebool, default=False

Passed to the literal detector.

Returns:
DetectorRegistry

A registry containing one RegexDetector per selected pattern and, when terms were given, one LiteralDetector.

Raises:
PatternError

If a requested kind is not in the pattern library.

Parameters:
Return type:

DetectorRegistry

Examples

>>> registry = default_registry(kinds=["EMAIL"], literal_terms=["Acme"])
>>> len(registry)
2