lab_rs/lib.rs
1//! read, write, and manipulate HTK .lab label files
2//!
3//! ```
4//! use lab_rs::LabFile;
5//!
6//! let lab: LabFile = "0 2500000 sil\n2500000 4200000 hh\n".parse()?;
7//! assert_eq!(lab.label_at_secs(0.3).unwrap().text, "hh");
8//! # Ok::<(), lab_rs::ParseError>(())
9//! ```
10//!
11//! times are integers in units of 100ns, parsing is tolerant: start/end
12//! times are optional, a trailing numeric score is allowed, and blank
13//! lines are ignored
14//!
15//! feature flags: `serde` adds Serialize/Deserialize, `cli` builds the
16//! `lab` binary
17
18#![warn(missing_docs)]
19
20mod error;
21mod file;
22mod label;
23
24pub use error::{ParseError, ParseErrorKind, ReadError, ScaleError};
25pub use file::LabFile;
26pub use label::{secs_to_units, units_to_secs, Label, UNITS_PER_SECOND};