Expand description
Defines regex replacement rules to filter text with.
This module defines the FilterRule type, which represents a regex replacement rule, as well as several functions that return lists of predefined filter rules.
Creating a FilterRule compiles a regular expression,
which means it is potentially expensive to call these predefined
filter rule functions in a loop.
Structs§
- Filter
Rule - Represents a regex replacement rule with a pattern and replacement text.
Functions§
- clean_
explicit_ filter_ rules - Filter rules to remove “Explicit” and “Clean” from a text.
- feature_
filter_ rules - Filter rules to remove feature information from a text.
- live_
filter_ rules - Filter rules to remove “Live…”-like strings from a text.
- normalize_
feature_ filter_ rules - Filter rules to normalize feature information to “Feat. Artist”.
- remastered_
filter_ rules - Filter rules to remove “Remastered…”-like strings from a text.
- suffix_
filter_ rules - Filter rules to normalize “- suffix” to “(suffix)” in a text.
- trim_
symbols_ filter_ rules - Filter rules to remove leftovers after filtering text using
youtube_track_filter_rules. - trim_
whitespace_ filter_ rules - Filter rules to remove leading and trailing whitespace from a text.
- version_
filter_ rules - Filter rules to remove version information (eg. “Album Version” or “Deluxe Edition”) from a text.
- youtube_
track_ filter_ rules - Filter rules to remove YouTube suffixes and prefixes from a text.