From a3b321142853e8afd440453d2b0618457a732196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <Pawel.Kedzia@pwr.wroc.pl> Date: Tue, 15 Nov 2011 16:09:13 +0100 Subject: [PATCH] Added Relations to Document --- libcorpus2/document.cpp | 2 +- libcorpus2/document.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/libcorpus2/document.cpp b/libcorpus2/document.cpp index 6cc6372..425fd20 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 777284a..6dd488e 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 */ -- GitLab