MCPcopy
hub / github.com/MinishLab/semble / detect_language

Function detect_language

src/semble/index/files.py:462–464  ·  view source on GitHub ↗

Detects the language of a file.

(file_name: Path)

Source from the content-addressed store, hash-verified

460
461
462def detect_language(file_name: Path) -> str | None:
463 """Detects the language of a file."""
464 return _EXTENSION_TO_LANGUAGE.get(file_name.suffix.lower())
465
466
467def get_extensions(types: Sequence[ContentType]) -> list[str]:

Callers 2

create_index_from_pathFunction · 0.90
test_detect_languageFunction · 0.90

Calls 1

getMethod · 0.80

Tested by 1

test_detect_languageFunction · 0.72