All records whose covered range starts closest to (but not before) gap_end.
(records: List[CovRecord], gap_end: int)
| 155 | |
| 156 | |
| 157 | def adjacent_after(records: List[CovRecord], gap_end: int) -> List[CovRecord]: |
| 158 | """All records whose covered range starts closest to (but not before) gap_end.""" |
| 159 | candidates = [r for r in records if r[1] >= gap_end] |
| 160 | if not candidates: |
| 161 | return [] |
| 162 | min_start = min(r[1] for r in candidates) |
| 163 | return [r for r in candidates if r[1] == min_start] |
| 164 | |
| 165 | |
| 166 | def snippet(text: str, start: int, end: int, tail: bool = False, maxlen: int = 60) -> str: |