commit b19f570b7d5480605c265ed97587c4c50b4ddbbb Author: Daniel Swanson Date: Thu Jun 10 12:40:56 2021 -0500 semi-fix << namespacing issue diff --git a/apertium/analysis.cc b/apertium/analysis.cc index 58776ed..b3394ba 100644 --- a/apertium/analysis.cc +++ b/apertium/analysis.cc @@ -16,16 +16,12 @@ #include "analysis.h" #include "exception.h" -#include "morpheme.h" - -#include -#include namespace Apertium { std::ostream &operator<<(std::ostream &Stream_, const Analysis &Analysis_) { + ::operator<<(Stream_, static_cast(Analysis_)); //Stream_ << static_cast(Analysis_); - // this line is giving a type error that I can't make sense of - // wstring wcerr TODO L"" + // namespace issue return Stream_; } diff --git a/apertium/morpheme.cc b/apertium/morpheme.cc index 0aa0640..2de0d8b 100644 --- a/apertium/morpheme.cc +++ b/apertium/morpheme.cc @@ -30,11 +30,13 @@ bool operator<(const Morpheme &a, const Morpheme &b) { } std::ostream& operator<<(std::ostream& out, const Morpheme &morph) { - // TODO! this isn't working for some reason - //out << morph.TheLemma; - //for (auto& it : morph.TheTags) { - // out << "<" << it.TheTag << ">"; - //} + ::operator<<(out, morph.TheLemma); + for (auto& it : morph.TheTags) { + out << '<'; + ::operator<<(out, it.TheTag); + out << '>'; + } + // namespace issue return out; } diff --git a/apertium/perceptron_spec.cc b/apertium/perceptron_spec.cc index b834493..7edeb66 100644 --- a/apertium/perceptron_spec.cc +++ b/apertium/perceptron_spec.cc @@ -734,8 +734,9 @@ void PerceptronSpec::Machine::unimplemented_opcode(UString opstr) { int bytecode_idx = bytecode_iter - feat.begin(); std::stringstream msg; - msg << "Unimplemented opcode: " //<< opstr // TODO - << " at " << (is_feature ? "feature" : "global") << " #" << feat_idx << " address #" << bytecode_idx; + msg << "Unimplemented opcode: "; + ::operator<<(msg, opstr); // namespace issue + msg << " at " << (is_feature ? "feature" : "global") << " #" << feat_idx << " address #" << bytecode_idx; throw Apertium::Exception::apertium_tagger::UnimplementedOpcode(msg); }