From 302c5a9de27469e7b6fe44f7093619e04314e719 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Wed, 30 Mar 2011 01:01:56 -0400 Subject: small fix for dynasearch neighborhoods --- decoder/ff_wordalign.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/decoder/ff_wordalign.cc b/decoder/ff_wordalign.cc index cdb8662a..9e7c618e 100644 --- a/decoder/ff_wordalign.cc +++ b/decoder/ff_wordalign.cc @@ -373,6 +373,11 @@ void SourceBigram::TraversalFeaturesImpl(const SentenceMetadata& smeta, out_word_count = edge.rule_->EWords(); assert(out_word_count == 1); // this is only defined for lex translation! // revisit this if you want to translate into null words + } else if (arity == 1) { + WordID left = *static_cast(ant_contexts[0]); + int left_wc = *(static_cast(ant_contexts[0]) + 1); + out_context = left; + out_word_count = left_wc; } else if (arity == 2) { WordID left = *static_cast(ant_contexts[0]); WordID right = *static_cast(ant_contexts[1]); -- cgit v1.2.3