"""What counts as a quote: whether a text holds a passage the judge quotes from the transcript, the premises, the records or a human's line.""" def verbatim(quote: str, text: str) -> bool: """Whether text holds the judge's quote word for word, once plain strips emphasis and reflows whitespace in both.""" quoted = plain(quote) return quoted != "" and quoted in plain(text) def plain(text: str) -> str: # The judge drops markdown emphasis and reflows whitespace when it quotes. return " ".join(text.replace("*", "").replace("_", "").split())