Module redlite.metric.util
Functions
normalize_string
def normalize_string(
input: str,
*,
to_lower=False,
strip_articles=False,
strip_punct=False,
normalize_whitespace=False
) -> str
Normalizes string.
- input (
str): Input string to normalize - to_lower (
bool): When setTrue, converts string to lower case. DefaultFalse. - strip_articles (
bool): When set toTruestrips English articles "a", "an", "the". DefaultFalse. - strip_punct (
bool): When set toTruestrips punctuation symbols (string.punctuation). DefaultFalse. - normalize_whitespace (
bool): When set toTrueconverts all whetespace to space, removes duplicate spaces, and strips leading and trailing space. DefaultFalse.
Returns transformed string.