pub fn decode(text: &str) -> Result<Decoded, RowError>Expand description
Read rows back. The result carries the bytes and what was repaired, so the person can be told which rows needed it.
ยงErrors
A character outside the alphabet, a row that cannot be repaired (more than one wrong character or two unreadable ones), a shape that is not rows, or a length that is not bytes, each named.
Case, separators and the letters a hand writes for digits are read through; a wrong character is repaired and its row named:
use rite_model::paper32;
let clean = paper32::decode("e9mq 8s8 | ph8b").unwrap();
assert_eq!(*clean.bytes, *b"rite");
assert!(clean.repaired.is_empty());
// The fifth character miscopied: still "rite", with row 1 named.
let slipped = paper32::decode("E9MQ9S8PH8B").unwrap();
assert_eq!(*slipped.bytes, *b"rite");
assert_eq!(slipped.repaired[0].row, 1);