MCPcopy Create free account
hub / github.com/RunanywhereAI/RCLI / process_pdf

Method process_pdf

src/rag/document_processor.cpp:212–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212std::vector<DocumentChunk> DocumentProcessor::process_pdf(const std::string& pdf_path) {
213 fprintf(stderr, "[DOC] Processing PDF: %s\n", pdf_path.c_str());
214
215 std::string text = extract_pdf_text(pdf_path);
216 if (text.empty()) {
217 fprintf(stderr, "[DOC] No text extracted from %s\n", pdf_path.c_str());
218 return {};
219 }
220
221 std::string filename = fs::path(pdf_path).filename().string();
222 auto chunks = semantic_chunk(text, filename);
223
224 fprintf(stderr, "[DOC] Extracted %zu chunks from %s\n", chunks.size(), filename.c_str());
225 return chunks;
226}
227
228std::string DocumentProcessor::extract_docx_text(const std::string& path) {
229 // .docx is a ZIP containing word/document.xml

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected