Skip to main content

Crate lab_rs

Crate lab_rs 

Source
Expand description

read, write, and manipulate HTK .lab label files

use lab_rs::LabFile;

let lab: LabFile = "0 2500000 sil\n2500000 4200000 hh\n".parse()?;
assert_eq!(lab.label_at_secs(0.3).unwrap().text, "hh");

times are integers in units of 100ns, parsing is tolerant: start/end times are optional, a trailing numeric score is allowed, and blank lines are ignored

feature flags: serde adds Serialize/Deserialize, cli builds the lab binary

Structs§

LabFile
a parsed .lab file, derefs to Vec<Label>
Label
a single labelled segment, times are in 100ns units as stored in the file, use the *_secs methods to work in seconds
ParseError
an error produced while parsing a .lab file

Enums§

ParseErrorKind
the specific kind of parse failure
ReadError
an error produced while reading a .lab from a reader or path

Constants§

UNITS_PER_SECOND
number of HTK time units (100ns) in one second

Functions§

secs_to_units
converts a time in seconds to 100ns units, rounding to nearest
units_to_secs
converts a time in 100ns units to seconds