1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Ukrainian text normalization, tokenization and sentence splitting.
//!
//! The crate is split into two independent halves:
//!
//! * [`rozpodil`] segments text into sentences and tokens, returning borrowed
//! [`Substring`](rozpodil::Substring) slices with byte offsets into the input.
//! * [`uktextnorm`] rewrites numbers, dates, units, currencies, abbreviations and
//! other machine-readable spellings into the words a Ukrainian speaker would say.
//!
//! ```
//! use ukrainian_tn::{rozpodil, uktextnorm};
//!
//! assert_eq!(uktextnorm::number_to_words(123), "сто двадцять три");
//! let sentences = rozpodil::split_sentences("Перше речення. Друге.");
//! assert_eq!(sentences.len(), 2);
//! ```
// These pedantic style lints conflict with deliberate crate design: the normalization
// passes keep their regexes beside the transformation that uses them, several passes
// are clearest as linear pipelines, and the public options type exposes independent
// feature switches rather than an artificial state machine.
/// The README, compiled as a doctest so its examples cannot drift from the API.
;