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.
Noneselectsdefault_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
RegexDetectorper selected pattern and, when terms were given, oneLiteralDetector.
- Raises:
- PatternError
If a requested kind is not in the pattern library.
- Parameters:
- Return type:
Examples
>>> registry = default_registry(kinds=["EMAIL"], literal_terms=["Acme"]) >>> len(registry) 2
Gallery examples#
Cleanprompt Advanced: Invariants, Encryption, and the Lossy Model Hop
Cleanprompt Advanced: Invariants, Encryption, and the Lossy Model Hop
Cleanprompt from Python: Single Calls and Edge Cases
Cleanprompt from Python: Single Calls and Edge Cases