(gt: Path, cache_dir: Path | None = None)
| 228 | |
| 229 | |
| 230 | def _generate_pickle_name(gt: Path, cache_dir: Path | None = None) -> str: |
| 231 | head, tail = os.path.splitext(gt) |
| 232 | if tail == ".txt": |
| 233 | tail = "" |
| 234 | name = head + tail + ".".join(map(str, sys.version_info)) + ".pickle" |
| 235 | if cache_dir: |
| 236 | return os.path.join(cache_dir, os.path.basename(name)) |
| 237 | else: |
| 238 | return name |
| 239 | |
| 240 | |
| 241 | def load_grammar( |
no outgoing calls
no test coverage detected