Skip to main content

normalize_text

Function normalize_text 

Source
pub fn normalize_text(text: &str) -> String
Expand description

Normalizes text using Unicode NFC normalization and trims excess whitespace

§Arguments

  • text - The text to normalize

§Returns

A normalized string

§Examples

use dom_content_extraction::unicode::normalize_text;

let text = "  café   \n  résumé  ";
assert_eq!(normalize_text(text), "café résumé");