diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-02-22 14:43:16 -0500 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-02-22 14:43:16 -0500 |
commit | ad4ed0105624590daf540d8f0c77d1c0cf28e9fd (patch) | |
tree | 7573e453f151dccd60e5387b4a92cce8db3fde1e /decoder/ff_spans.cc | |
parent | 4324cdb03ec1f8332ad053e9f4f85170027b3938 (diff) |
split features more
Diffstat (limited to 'decoder/ff_spans.cc')
-rw-r--r-- | decoder/ff_spans.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/decoder/ff_spans.cc b/decoder/ff_spans.cc index 06593727..6e92535a 100644 --- a/decoder/ff_spans.cc +++ b/decoder/ff_spans.cc @@ -54,7 +54,10 @@ void SpanFeatures::TraversalFeaturesImpl(const SentenceMetadata& smeta, assert(edge.i_ < beg_span_ids_.size()); assert(edge.i_ >= 0); features->set_value(beg_span_ids_[edge.i_], 1); - features->set_value(span_feats_(edge.i_,edge.j_), 1); + if (edge.rule_->lhs_ == kS) + features->set_value(span_feats_(edge.i_,edge.j_).second, 1); + else + features->set_value(span_feats_(edge.i_,edge.j_).second, 1); if (edge.Arity() == 2) { const TRule& rule = *edge.rule_; if (rule.f_[0] == kS && rule.f_[1] == kX) { @@ -105,7 +108,8 @@ void SpanFeatures::PrepareForInput(const SentenceMetadata& smeta) { word = MapIfNecessary(word); ostringstream pf; pf << "SS:" << TD::Convert(bword) << "_" << TD::Convert(word); - span_feats_(i,j) = FD::Convert(pf.str()); + span_feats_(i,j).first = FD::Convert(pf.str()); + span_feats_(i,j).second = FD::Convert("S_" + pf.str()); } } } |