eta.util.general.standardize
- standardize(str, remove_parentheticals=False)[source]
Standardize a string by applying a series of transformations.
Specifically:
Replace – with -, and _ with whitespace.
Remove parenthetical content (i.e., […] or …), if remove_parentheticals is True.
Add whitespace around all punctuation.
Collapse all whitespace to a single space.
Convert to lowercase.