0823f7aa48
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
14 lines
398 B
Python
14 lines
398 B
Python
from .base import BaseParser
|
|
|
|
|
|
async def select_parser(ext: str) -> BaseParser:
|
|
if ext in {".md", ".txt", ".markdown", ".xlsx", ".docx", ".xls"}:
|
|
from .markitdown_parser import MarkitdownParser
|
|
|
|
return MarkitdownParser()
|
|
elif ext == ".pdf":
|
|
from .pdf_parser import PDFParser
|
|
|
|
return PDFParser()
|
|
raise ValueError(f"暂时不支持的文件格式: {ext}")
|