13 lines
562 B
Python
13 lines
562 B
Python
"""What counts as a quote, for every check of a passage the judge or the worker quotes: of 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())
|