| 280 | } |
| 281 | |
| 282 | std::vector<DocumentChunk> DocumentProcessor::process_docx(const std::string& docx_path) { |
| 283 | fprintf(stderr, "[DOC] Processing DOCX: %s\n", docx_path.c_str()); |
| 284 | std::string text = extract_docx_text(docx_path); |
| 285 | if (text.empty()) { |
| 286 | fprintf(stderr, "[DOC] No text extracted from %s\n", docx_path.c_str()); |
| 287 | return {}; |
| 288 | } |
| 289 | std::string filename = fs::path(docx_path).filename().string(); |
| 290 | auto chunks = semantic_chunk(text, filename); |
| 291 | fprintf(stderr, "[DOC] Extracted %zu chunks from %s\n", chunks.size(), filename.c_str()); |
| 292 | return chunks; |
| 293 | } |
| 294 | |
| 295 | std::vector<DocumentChunk> DocumentProcessor::process_file(const std::string& file_path) { |
| 296 | if (!fs::exists(file_path) || !fs::is_regular_file(file_path)) { |