summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2013-03-14 23:46:46 -0400
committerChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2013-03-14 23:46:46 -0400
commit5a338d692aba7b8dcd682b96ed3f3e600187c176 (patch)
treeddb89f2b1a15588ee285e9571702a21d04034714
parent5f680cc45266112c0a6f51f8d9eeb99732a6e2d7 (diff)
fix source path
-rw-r--r--decoder/cdec_ff.cc2
-rw-r--r--decoder/ff_source_path.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/decoder/cdec_ff.cc b/decoder/cdec_ff.cc
index a60f2c33..0bf441d4 100644
--- a/decoder/cdec_ff.cc
+++ b/decoder/cdec_ff.cc
@@ -71,7 +71,7 @@ void register_feature_functions() {
ff_registry.Register("InputIndicator", new FFFactory<InputIndicator>);
ff_registry.Register("LexicalTranslationTrigger", new FFFactory<LexicalTranslationTrigger>);
ff_registry.Register("WordPairFeatures", new FFFactory<WordPairFeatures>);
- ff_registry.Register("SourthPathFeatures", new FFFactory<SourcePathFeatures>);
+ ff_registry.Register("SourcePathFeatures", new FFFactory<SourcePathFeatures>);
ff_registry.Register("WordSet", new FFFactory<WordSet>);
ff_registry.Register("Dwarf", new FFFactory<Dwarf>);
ff_registry.Register("External", new FFFactory<ExternalFeature>);
diff --git a/decoder/ff_source_path.cc b/decoder/ff_source_path.cc
index d5fa6bb3..56cbfc48 100644
--- a/decoder/ff_source_path.cc
+++ b/decoder/ff_source_path.cc
@@ -30,7 +30,7 @@ void SourcePathFeatures::TraversalFeaturesImpl(const SentenceMetadata& smeta,
for (unsigned i = 0; i < f.size(); ++i) {
int cur = f[i];
if (cur <= 0)
- cur = *reinterpret_cast<const WordID*>(ant_contexts[cur]);
+ cur = *reinterpret_cast<const WordID*>(ant_contexts[-cur]);
else
FireUnigramFeature(cur, features);
if (prev) FireBigramFeature(prev, cur, features);