MCPcopy
hub / github.com/hydropix/TranslateBooksWithLLMs / load_languages

Function load_languages

benchmark/data_loader.py:41–53  ·  view source on GitHub ↗

Load languages from the split layout, or the legacy YAML as fallback.

(
    base_dir: Path,
    legacy_file: Path,
)

Source from the content-addressed store, hash-verified

39
40
41def load_languages(
42 base_dir: Path,
43 legacy_file: Path,
44) -> dict[str, Language]:
45 """Load languages from the split layout, or the legacy YAML as fallback."""
46 split_dir = _split_languages_dir(base_dir)
47 if split_dir.is_dir():
48 return _load_languages_split(split_dir)
49 if legacy_file.exists():
50 return _load_languages_legacy(legacy_file)
51 raise FileNotFoundError(
52 f"No language data found. Looked in {split_dir} and {legacy_file}."
53 )
54
55
56def load_reference_texts(

Callers 3

load_languagesMethod · 0.90
load_tasksFunction · 0.90
__init__Method · 0.85

Calls 4

_split_languages_dirFunction · 0.85
_load_languages_splitFunction · 0.85
_load_languages_legacyFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected