(pattern: str)
| 191 | |
| 192 | |
| 193 | def parse_pattern(pattern: str) -> list[tuple[bool, int]]: |
| 194 | parts = pattern.split(",") |
| 195 | result = [] |
| 196 | for i, part in enumerate(parts): |
| 197 | n = int(part) |
| 198 | if i % 2 == 0: |
| 199 | result.append((True, n)) # get n words |
| 200 | else: |
| 201 | result.append((False, n)) # skip n words |
| 202 | return result |
| 203 | |
| 204 | |
| 205 | def parse_args() -> argparse.Namespace: |