ai / backend /chunking /language_detector.py
3v324v23's picture
agent
b4291bc
Raw
History Blame Contribute Delete
230 Bytes
from pathlib import Path
from backend.core.constants import LANGUAGE_MAP
def detect_language(path: Path) -> str:
if path.name == ".env.example":
return "env"
return LANGUAGE_MAP.get(path.suffix.lower(), "text")