From a0c29e76bdff3d1ab534460c2ef2a58b796d5d42 Mon Sep 17 00:00:00 2001 From: jdenys Date: Tue, 26 Jan 2021 17:53:58 +0100 Subject: [PATCH] Fix compilation problems for paths on Linux (#33) Paths with attributes are now emitted for Japanese, but there were compilation problems with Japanese paths on Linux. --- modules/engine/src/engine.cpp | 2 +- modules/engine/src/engine.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/engine/src/engine.cpp b/modules/engine/src/engine.cpp index b3c745f0..1df02df3 100644 --- a/modules/engine/src/engine.cpp +++ b/modules/engine/src/engine.cpp @@ -276,7 +276,7 @@ static void iKnowEngineOutputCallback(iknow::core::IkIndexOutput* data, iknow::c PropertyId entity_vector_prop_id = kb->PropertyIdForName(kEntityVectorTypeName); iknowdata::Attribute a_type = static_cast(entity_vector_prop_id); - sentence_data.sent_attributes.push_back(Sent_Attribute(a_type, NULL, NULL, string())); // generate entity vector marker + sentence_data.sent_attributes.push_back(Sent_Attribute(a_type)); // generate entity vector marker // sentence_data.sent_attributes.back().entity_ref = static_cast(sentence_data.entities.size()); // connect sentence attribute to entity for (IkSentence::EntityVector::const_iterator i = entity_vector.begin(); i != entity_vector.end(); ++i) { // collect entity id's diff --git a/modules/engine/src/engine.h b/modules/engine/src/engine.h index 14b3da7a..5292b0fb 100644 --- a/modules/engine/src/engine.h +++ b/modules/engine/src/engine.h @@ -109,7 +109,10 @@ namespace iknowdata { // to bundle all generated data Sent_Attribute(Attribute att_type, size_t start, size_t stop, std::string& marker - ) : type_(att_type), offset_start_(start), offset_stop_(stop), marker_(marker) {} + ) : type_(att_type), offset_start_(start), offset_stop_(stop), marker_(marker), entity_ref(0) {} + + Sent_Attribute(Attribute att_type) : // Entity Vector attributes, no markers, no corresponding offsets + type_(att_type), offset_start_(NULL), offset_stop_(NULL), entity_ref(0) {} Attribute type_; size_t offset_start_, offset_stop_; // these refer to offsets in the text, "start" is where the textual representation starts, "stop" is where it stops.