diff --git a/libwccl/ops/functions/position/relativeposition.cpp b/libwccl/ops/functions/position/relativeposition.cpp index a2e98d20f20b27ba7d71904fb6b8f043dfda3a00..c9cf64fb4897463b34cbc0a25e184d23286a3d3b 100644 --- a/libwccl/ops/functions/position/relativeposition.cpp +++ b/libwccl/ops/functions/position/relativeposition.cpp @@ -7,10 +7,9 @@ namespace Wccl { RelativePosition::BaseRetValPtr RelativePosition::apply_internal( const FunExecContext &context) const { - static const Constant<Position> nowhere((Position(Position::Nowhere))); const RetValPtr& orig_pos = pos_expr_->apply(context); if(orig_pos->get_value() == Position::Nowhere) { - return nowhere.apply(context); + return detail::DefaultFunction<Position>()->apply(context); } const SentenceContext& sc = context.sentence_context(); return RetValPtr(new Position(offset_ + sc.get_rel_position(*orig_pos))); @@ -18,7 +17,7 @@ RelativePosition::BaseRetValPtr RelativePosition::apply_internal( std::string RelativePosition::to_string(const Corpus2::Tagset &tagset) const { - std::stringstream ss; + std::ostringstream ss; ss << pos_expr_->to_string(tagset); if(offset_ >= 0) { ss << " + " << offset_; @@ -30,7 +29,7 @@ std::string RelativePosition::to_string(const Corpus2::Tagset &tagset) const std::string RelativePosition::to_raw_string() const { - std::stringstream ss; + std::ostringstream ss; ss << pos_expr_->to_raw_string(); if(offset_ >= 0) { ss << " + " << offset_; diff --git a/libwccl/ops/functions/position/relativeposition.h b/libwccl/ops/functions/position/relativeposition.h index 9324d42e11c3aa2034ee4f10c5c33cf7bae7d1a6..a29c2d081dd1aa65b0fb8e3e6d4c5da21e3d7fd1 100644 --- a/libwccl/ops/functions/position/relativeposition.h +++ b/libwccl/ops/functions/position/relativeposition.h @@ -2,7 +2,6 @@ #define LIBWCCL_OPS_FUNCTIONS_POSITION_RELATIVEPOSITION_H #include <libwccl/ops/function.h> -#include <libwccl/ops/formatters.h> #include <libwccl/values/position.h> namespace Wccl {