Skip to main content

read_ltr_from_bytes

Function read_ltr_from_bytes 

Source
pub fn read_ltr_from_bytes(bytes: &[u8]) -> Result<Ltr, LtrBinaryError>
Expand description

Reads an LTR file directly from bytes.

ยงErrors

LtrBinaryError::InvalidMagic and LtrBinaryError::InvalidVersion for a header that is not an LTR of a supported version, LtrBinaryError::UnsupportedLetterCount for an alphabet size this reader has no table shape for, and LtrBinaryError::InvalidHeader when the probability tables run past the end of bytes.