(documents)
| 196 | |
| 197 | # Process uploaded documents |
| 198 | def process_documents(documents): |
| 199 | processed_docs = [] |
| 200 | for doc in documents: |
| 201 | if doc.endswith('.pdf'): |
| 202 | processed_docs.append(process_pdf(doc)) |
| 203 | elif doc.endswith(('.doc', '.docx')): |
| 204 | text = read_word_file(doc) |
| 205 | txt_filepath = save_extracted_text_to_txt(text, os.path.basename(doc)) |
| 206 | processed_docs.append(txt_filepath) |
| 207 | elif doc.endswith(('.mp3', '.mp4', '.mpeg')): |
| 208 | processed_docs.append(transcribe_and_save(doc)) |
| 209 | else: |
| 210 | processed_docs.append(doc) |
| 211 | return processed_docs |
| 212 | |
| 213 | # Process PDF files |
| 214 | def process_pdf(pdf_path): |
no test coverage detected