Skip to main content

equivalent_values

Function equivalent_values 

Source
pub fn equivalent_values(a: &Value, b: &Value) -> bool
Expand description

Whether two state values say the same thing.

Strings compare after lowercasing and dropping spaces and punctuation, so “tomorrow at 7 pm” and “Tomorrow at 7 PM.” are equal. Punctuation between two digits is kept: it is part of a number, time, date or identifier, so “1.0 mg” and “10 mg”, or “10:30” and “1030”, differ. Numbers compare by value (4 and 4.0), and a number equals a string that spells it (“4”). Arrays and objects compare element by element.

An extractor re-reads the transcript every turn and re-states values it already found in slightly different words; those re-statements are not corrections.