diff --git a/libwccl/ops/actions/unify.cpp b/libwccl/ops/actions/unify.cpp index 692aa5d338f518c619fdbbc0553ea0ecfb8a5ac6..0733efdd7ea3f413bb1e64a5c119164a461161d8 100644 --- a/libwccl/ops/actions/unify.cpp +++ b/libwccl/ops/actions/unify.cpp @@ -70,37 +70,27 @@ Bool Unify::execute(const ActionExecContext& context) const // there is no agreement possible, abort with no changes changed.set_value(false); return changed; - } else { - // there were underspecified lexemes, they will be left in the end - // so agreement is met anyway, however we need to mark that - // changes were made because we removed some lexemes that did not - // meet agreement; - // "previous" index has to be left alone though, pointing at previous - // token that still had some agreedable lexemes - changed.set_value(true); } } else { // some non-underspecified lexemes are left, so // next time around, "previous" token is going to be the current one previous = i; - // there were changes only if we actually removed something - if (curr_rem.size() != remainings[i].size()) { - changed.set_value(true); - remainings[i] = curr_rem; - } + } + // there were changes only if we actually removed something + if (curr_rem.size() != remainings[i].size()) { + changed.set_value(true); + remainings[i] = curr_rem; } } } // finally assign remaining lexemes to original tokens if (changed.get_value()) { for (size_t i = 0; i < remainings.size(); ++i) { - if (remainings[i].size() > 0) { - std::vector<Corpus2::Lexeme>& lexemes = sc.at(i + abs_left)->lexemes(); - lexemes = remainings[i]; - // underspecced lexemes meet agreement too, so leave them in the end, if any - foreach (const Corpus2::Lexeme& lex, underspecifieds[i]) { - lexemes.push_back(lex); - } + std::vector<Corpus2::Lexeme>& lexemes = sc.at(i + abs_left)->lexemes(); + lexemes = remainings[i]; + // underspecced lexemes meet agreement too, so leave them in the end, if any + foreach (const Corpus2::Lexeme& lex, underspecifieds[i]) { + lexemes.push_back(lex); } } }