github-actions[bot]
Auto-sync from demo at Thu Oct 23 11:07:54 UTC 2025
0b9d8c7
raw
history blame
432 Bytes
from typing import Any, Dict, List
from graphgen.bases.base_reader import BaseReader
class TXTReader(BaseReader):
def read(self, file_path: str) -> List[Dict[str, Any]]:
docs = []
with open(file_path, "r", encoding="utf-8") as f:
for line in f:
line = line.strip()
if line:
docs.append({self.text_column: line})
return self.filter(docs)