diff --git a/libcorpus2/document.cpp b/libcorpus2/document.cpp index 6cc6372cb821c0b142154652bb78036224e9243a..425fd2064a83b142fea2f939c7f5f96f040e5dda 100644 --- a/libcorpus2/document.cpp +++ b/libcorpus2/document.cpp @@ -20,7 +20,7 @@ or FITNESS FOR A PARTICULAR PURPOSE. namespace Corpus2 { Document::Document() - : paragraphs_() + : paragraphs_(), relations_() { } diff --git a/libcorpus2/document.h b/libcorpus2/document.h index 777284a427944e68c744b60f8868d95e37aa5b2d..6dd488e026402bdeea5879520455e811f215bcc9 100644 --- a/libcorpus2/document.h +++ b/libcorpus2/document.h @@ -18,6 +18,7 @@ or FITNESS FOR A PARTICULAR PURPOSE. #define LIBCORPUS2_DOCUMENT_H #include <libcorpus2/chunk.h> +#include <libcorpus2/relation.h> #include <boost/shared_ptr.hpp> namespace Corpus2 { @@ -34,16 +35,32 @@ public: Document(); ~Document(); + /// Adds paragraphs to document void add_paragraph(const boost::shared_ptr<Chunk> para) { paragraphs_.push_back(para); } + /// Adds relation to document relations + void add_relation(const boost::shared_ptr<Relation> relation) { + relations_.push_back(relation); + } + + /// Paragraphs accessor const std::vector< boost::shared_ptr<Chunk> >& paragraphs() const { return paragraphs_; } + /// Relations accessor + const std::vector< boost::shared_ptr<Relation> >& relations() const { + return relations_; + } + protected: + /// Paragraphs in document std::vector< boost::shared_ptr<Chunk> > paragraphs_; + + /// Relations in document + std::vector< boost::shared_ptr<Relation> > relations_; }; } /* end ns Corpus2 */