From ba50c5fcb66eebf4ec8f0f698da6d9eb2113d20d Mon Sep 17 00:00:00 2001 From: Adam Radziszewski <adam.radziszewski@pwr.wroc.pl> Date: Thu, 6 Dec 2012 15:53:59 +0100 Subject: [PATCH] fix Sentence and AnnotatedSentence cloning: preserve ids --- CMakeLists.txt | 2 +- libcorpus2/ann/annotatedsentence.cpp | 2 +- libcorpus2/sentence.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd9d2a7..71cec9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ PROJECT(Corpus2Library) set(corpus2_ver_major "1") set(corpus2_ver_minor "2") -set(corpus2_ver_patch "1") +set(corpus2_ver_patch "2") cmake_minimum_required(VERSION 2.8.0) diff --git a/libcorpus2/ann/annotatedsentence.cpp b/libcorpus2/ann/annotatedsentence.cpp index 50c5ae8..6d41d86 100644 --- a/libcorpus2/ann/annotatedsentence.cpp +++ b/libcorpus2/ann/annotatedsentence.cpp @@ -34,7 +34,7 @@ AnnotatedSentence::~AnnotatedSentence() Sentence::Ptr AnnotatedSentence::clone_shared() const { boost::shared_ptr<AnnotatedSentence> copy; - copy = boost::make_shared<AnnotatedSentence>(); + copy = boost::make_shared<AnnotatedSentence>(id_); BOOST_FOREACH(const Token* t, tokens_) { copy->append(t->clone()); } diff --git a/libcorpus2/sentence.cpp b/libcorpus2/sentence.cpp index bb76754..073d9a4 100644 --- a/libcorpus2/sentence.cpp +++ b/libcorpus2/sentence.cpp @@ -33,7 +33,7 @@ Sentence::~Sentence() Sentence::Ptr Sentence::clone_shared() const { - Sentence::Ptr s = boost::make_shared<Sentence>(); + Sentence::Ptr s = boost::make_shared<Sentence>(id_); BOOST_FOREACH(const Token* t, tokens_) { s->append(t->clone()); } -- GitLab