DocWire DocToText - Powered by Silvercoders 5.0.5
A multifaceted, data extraction software development toolkit that converts all sorts of files to plain text and html. Written in C++, this data extraction tool has a parser able to convert PST & OST files along with a brand new API for better file processing. To enhance its utility, DocToText, as a data extraction tool, can be integrated with other data mining and data analytics applications. It comes equipped with a high grade, scriptable and trainable OCR that has LSTM neural networks based character recognition. This document parser is able to extract metadata along with annotations and supports a list of formats that include: DOC, XLS, XLSB, PPT, RTF, ODF (ODT, ODS, ODP), OOXML (DOCX, XLSX, PPTX), iWork (PAGES, NUMBERS, KEYNOTE), ODFXML (FODP, FODS, FODT), PDF, EML, HTML, Outlook (PST, OST), Image (JPG, JPEG, JFIF, BMP, PNM, PNG, TIFF, WEBP) and DICOM (DCM)
example_3.cpp
1
2#include <iostream>
3#include <memory>
4
5#include "parser.h"
6#include "importer.h"
7#include "exporter.h"
8#include "transformer.h"
9#include "parsing_chain.h"
10
15int main(int argc, char* argv[])
16{
17 doctotext::Importer(argv[1])
18 | doctotext::TransformerFunc([](doctotext::Info &info) // Create an importer from file name and connect it to transformer
19 {
20 if (info.tag_name == doctotext::StandardTag::TAG_MAIL) // if current node is mail
21 {
22 auto subject = info.getAttributeValue<std::string>("subject"); // get the subject attribute
23 if (subject) // if subject attribute exists
24 {
25 if (subject->find("Hello") != std::string::npos) // if subject contains "Hello"
26 {
27 info.skip = true; // skip the current node
28 }
29 }
30 }
31 })
32 | doctotext::PlainTextExporter() // sets exporter to plain text
33 | std::cout; // sets output stream
34 return 0;
35}
The Importer class. This class is used to import a file and parse it using available parsers.
Definition: importer.h:57
Exporter class for plain text output.
Definition: exporter.h:137
static const std::string TAG_MAIL
Tag for mail. Attributes: "subject": std::string, "date": uint (unix timestamp).
Definition: parser.h:82
Wraps single function (doctotext::NewNodeCallback) into Transformer object.
Definition: transformer.h:87
std::string tag_name
tag name
Definition: parser.h:100