normalize_text#

scikitplot.corpus.normalize_text(text, *, config=None)[source]#

Normalise text according to config.

Parameters:
textstr

Raw text to normalise.

configNormalizerConfig or None, optional

Configuration. None uses defaults.

Returns:
str or None

Normalised text, or None if the result is shorter than config.min_length.

Parameters:
Return type:

str | None

Examples

>>> normalize_text("The  first  compu-\\nter  was huge.")
'The first computer was huge.'