Initial upload: TermDiagram v0.1.0
Some checks failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled

This commit is contained in:
2026-01-29 22:28:05 +00:00
parent 1caad5b2e7
commit 85f44b1412

View File

@@ -0,0 +1,25 @@
from typing import List
class LanguageDetector:
SUPPORTED_EXTENSIONS = {
"py": "python",
"js": "javascript",
"ts": "typescript",
"rs": "rust",
"go": "go",
"java": "java",
"cpp": "cpp",
"c": "c",
"rb": "ruby",
"php": "php",
}
def is_supported(self, extension: str) -> bool:
return extension in self.SUPPORTED_EXTENSIONS
def get_language(self, extension: str) -> Optional[str]:
return self.SUPPORTED_EXTENSIONS.get(extension)
def get_supported_extensions(self) -> List[str]:
return list(self.SUPPORTED_EXTENSIONS.keys())