Skip to main content

Worked Examples

A quoted field changes the parsing problem​

Input record: "Reading, notes",25. A naive comma split sees three pieces; a CSV parser yields topic Reading, notes and token 25. Strip the fields, convert the token under the ASCII-digit rule, check 1–240, then construct the record. The library handles syntax; your function establishes the domain rule.

Four records become a report​

The supplied file has durations 25, 15, 25 and 10. The report count is 4, total 75, Python total 40, Reading, notes total 25 and Café total 10. Trace the group map after each record. Repeated topics accumulate; repeated complete records also remain separate sessions.

Failure before output​

Replace the final duration with 0 in a copy. Predict a rejected import, not a total of 65. If your implementation skips the row, the summary looks reasonable but no longer describes the complete source. Restore the valid fixture and confirm the original input bytes never changed.