Skip to content
Snippets Groups Projects
Commit ba50c5fc authored by Adam Radziszewski's avatar Adam Radziszewski
Browse files

fix Sentence and AnnotatedSentence cloning: preserve ids

parent a878d625
Branches
No related merge requests found
...@@ -2,7 +2,7 @@ PROJECT(Corpus2Library) ...@@ -2,7 +2,7 @@ PROJECT(Corpus2Library)
set(corpus2_ver_major "1") set(corpus2_ver_major "1")
set(corpus2_ver_minor "2") set(corpus2_ver_minor "2")
set(corpus2_ver_patch "1") set(corpus2_ver_patch "2")
cmake_minimum_required(VERSION 2.8.0) cmake_minimum_required(VERSION 2.8.0)
......
...@@ -34,7 +34,7 @@ AnnotatedSentence::~AnnotatedSentence() ...@@ -34,7 +34,7 @@ AnnotatedSentence::~AnnotatedSentence()
Sentence::Ptr AnnotatedSentence::clone_shared() const Sentence::Ptr AnnotatedSentence::clone_shared() const
{ {
boost::shared_ptr<AnnotatedSentence> copy; boost::shared_ptr<AnnotatedSentence> copy;
copy = boost::make_shared<AnnotatedSentence>(); copy = boost::make_shared<AnnotatedSentence>(id_);
BOOST_FOREACH(const Token* t, tokens_) { BOOST_FOREACH(const Token* t, tokens_) {
copy->append(t->clone()); copy->append(t->clone());
} }
......
...@@ -33,7 +33,7 @@ Sentence::~Sentence() ...@@ -33,7 +33,7 @@ Sentence::~Sentence()
Sentence::Ptr Sentence::clone_shared() const 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_) { BOOST_FOREACH(const Token* t, tokens_) {
s->append(t->clone()); s->append(t->clone());
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment