Skip to content
Snippets Groups Projects
Commit 8d0e3cf5 authored by michal's avatar michal
Browse files

fix wrap_sentence and wrap_sentence_clone in AnnotatedSentence - perserve id

parent ba50c5fc
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 "2") set(corpus2_ver_patch "3")
cmake_minimum_required(VERSION 2.8.0) cmake_minimum_required(VERSION 2.8.0)
......
...@@ -48,7 +48,7 @@ boost::shared_ptr<AnnotatedSentence> AnnotatedSentence::wrap_sentence( ...@@ -48,7 +48,7 @@ boost::shared_ptr<AnnotatedSentence> AnnotatedSentence::wrap_sentence(
boost::shared_ptr<AnnotatedSentence> a; boost::shared_ptr<AnnotatedSentence> a;
a = boost::dynamic_pointer_cast<AnnotatedSentence>(s); a = boost::dynamic_pointer_cast<AnnotatedSentence>(s);
if (!a) { if (!a) {
a = boost::make_shared<AnnotatedSentence>(); a = boost::make_shared<AnnotatedSentence>(s->id());
BOOST_FOREACH(Token* t, s->tokens()) { BOOST_FOREACH(Token* t, s->tokens()) {
a->append(t); a->append(t);
} }
...@@ -63,7 +63,7 @@ boost::shared_ptr<AnnotatedSentence> AnnotatedSentence::wrap_sentence_clone( ...@@ -63,7 +63,7 @@ boost::shared_ptr<AnnotatedSentence> AnnotatedSentence::wrap_sentence_clone(
boost::shared_ptr<AnnotatedSentence> a; boost::shared_ptr<AnnotatedSentence> a;
a = boost::dynamic_pointer_cast<AnnotatedSentence>(s); a = boost::dynamic_pointer_cast<AnnotatedSentence>(s);
if (!a) { if (!a) {
a = boost::make_shared<AnnotatedSentence>(); a = boost::make_shared<AnnotatedSentence>(s->id());
BOOST_FOREACH(Token* t, s->tokens()) { BOOST_FOREACH(Token* t, s->tokens()) {
a->append(t->clone()); a->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