Module crowbook_text_processing::clean [] [src]

This module provides function to "clean" a text typographically.

Example

use crowbook_text_processing::clean;
let input = "Some  'text'  whose formatting  could be enhanced...";
let output = clean::quotes(clean::ellipsis(clean::whitespaces(input)));
assert_eq!(&output, "Some ‘text’ whose formatting could be enhanced…");

Functions

dashes

Replace double dashes (--) and triple dashes (---) to en dash and em dash, respectively.

ellipsis

Replace ellipsis (...) with the appropriate unicode character

guillemets

Replaces << with « and >> with ».

quotes

Replace straight quotes with more typographic variants

whitespaces

Removes unnecessary whitespaces from a String.