Skip to main content

Module transcript

Module transcript 

Source
Expand description

Transcript detection: the one classifier the transform tier cannot pin.

is_transcript_like_markdown is not reachable from unwrap_markdown_prose — the CLI asks it before the transform runs, and answers yes by leaving the file alone entirely. So corpus/cases/ says nothing about it and corpus/cli/ says everything, which is why the process tier was built first.

Both heading patterns count characters over an ASCII class, so the counted quantifiers here are the only ones in the crate where the character count and the byte count could part company — and they cannot, because a non-ASCII character is not in either class and stops the run before the count is reached.

Every expected value in the tests below came from running the Python.

Constants§

TRANSCRIPT_HEADING_FLOOR
_TRANSCRIPT_HEADING_FLOOR: fewer headings than this is not a transcript.
TRANSCRIPT_HEADING_RATIO
_TRANSCRIPT_HEADING_RATIO: the density a transcript has to clear.

Functions§

is_transcript_like_markdown
_is_transcript_like_markdown: does this document use repeated speaker turns?
match_bare_speaker_heading
_MATCH_BARE_SPEAKER_HEADING: ^[A-Z][a-zA-Z0-9_. -]{0,39}:$.
match_timestamped_speaker_heading
_MATCH_TIMESTAMPED_SPEAKER_HEADING: ^[A-Z][a-zA-Z0-9_.-]{0,19} [0-9]{1,2}:[0-9]{2}$.