GianJSX's picture
Duplicate from zej97/AI-Research-Assistant
cc93c47
raw
history blame
392 Bytes
"""Text processing functions"""
from typing import Dict, Generator
from config import Config
import os
CFG = Config()
def read_txt_files(directory):
all_text = ''
for filename in os.listdir(directory):
if filename.endswith('.txt'):
with open(os.path.join(directory, filename), 'r') as file:
all_text += file.read() + '\n'
return all_text