Skip to main content

Crate text_processing_rs

Crate text_processing_rs 

Source
Expand description

§text-processing-rs

Inverse Text Normalization (ITN) — convert spoken-form ASR output to written form.

Converts spoken-form text to written form:

  • “two hundred thirty two” → “232”
  • “five dollars and fifty cents” → “$5.50”
  • “january fifth twenty twenty five” → “January 5, 2025”

§Usage

use text_processing_rs::normalize;

let result = normalize("two hundred");
assert_eq!(result, "200");

Modules§

custom_rules
Custom user-defined normalization rules.
taggers
Taggers for inverse text normalization.

Functions§

normalize
Normalize spoken-form text to written form.
normalize_sentence
Normalize a full sentence, replacing spoken-form spans with written form.
normalize_sentence_with_max_span
Normalize a full sentence with a configurable max span size.
normalize_with_lang
Normalize with language selection (future use).