Skip to main content

partial_date/
lib.rs

1//! # partial-date
2//!
3//! Deterministic partial date extraction from natural language text.
4//!
5//! Unlike full-date parsers, this library handles *partial* dates — inputs where only some
6//! of day, month, or year are present. Missing components can be left as [`models::Extracted::NotFound`]
7//! or filled with a caller-supplied default via [`models::Extracted::Defaulted`].
8//!
9//! ## Quick start
10//!
11//! ```rust
12//! use partial_date::models::{Input, PartialDate};
13//!
14//! let input = Input {
15//!     utterance: "12 June".to_string(),
16//!     config: None,
17//! };
18//!
19//! // let result: PartialDate = partial_date::extract::extract(input);
20//! ```
21
22pub mod extract;
23pub mod levenshtein;
24pub mod models;
25pub mod word_numbers;
26
27// Internal modules
28mod interpreter;
29mod tokeniser;
30mod validator;