scrubadub.filth¶
Filth objects are responsible for marking particular sections of text as
containing that type of filth. It is also responsible for knowing how it should
be cleaned. Every type of Filth
inherits from scrubadub.filth.base.Filth
.
- class scrubadub.filth.Filth(beg: Optional[int] = None, end: Optional[int] = None, text: Optional[str] = None, match: Optional[Match] = None, detector_name: Optional[str] = None, document_name: Optional[str] = None, replacement_string: Optional[str] = None, locale: Optional[str] = None, **kwargs)[source]¶
Bases:
object
This is the base class for all
Filth
that is detected in dirty dirty text.- prefix: ClassVar[str] = '{{'¶
- suffix: ClassVar[str] = '}}'¶
- type: ClassVar[str] = 'unknown'¶
- lookup = <scrubadub.utils.Lookup object>¶
- regex: Optional[Pattern[str]] = None¶
- __init__(beg: Optional[int] = None, end: Optional[int] = None, text: Optional[str] = None, match: Optional[Match] = None, detector_name: Optional[str] = None, document_name: Optional[str] = None, replacement_string: Optional[str] = None, locale: Optional[str] = None, **kwargs)[source]¶
- property placeholder: str¶
- property identifier: str¶
- merge(other_filth: scrubadub.filth.base.Filth) scrubadub.filth.base.MergedFilth [source]¶