From 5f680cc45266112c0a6f51f8d9eeb99732a6e2d7 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Thu, 14 Mar 2013 23:38:41 -0400 Subject: source path features --- decoder/cdec_ff.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'decoder/cdec_ff.cc') diff --git a/decoder/cdec_ff.cc b/decoder/cdec_ff.cc index 3ab0f9f6..a60f2c33 100644 --- a/decoder/cdec_ff.cc +++ b/decoder/cdec_ff.cc @@ -14,6 +14,7 @@ #include "ff_rules.h" #include "ff_ruleshape.h" #include "ff_bleu.h" +#include "ff_source_path.h" #include "ff_source_syntax.h" #include "ff_register.h" #include "ff_charset.h" @@ -70,6 +71,7 @@ void register_feature_functions() { ff_registry.Register("InputIndicator", new FFFactory); ff_registry.Register("LexicalTranslationTrigger", new FFFactory); ff_registry.Register("WordPairFeatures", new FFFactory); + ff_registry.Register("SourthPathFeatures", new FFFactory); ff_registry.Register("WordSet", new FFFactory); ff_registry.Register("Dwarf", new FFFactory); ff_registry.Register("External", new FFFactory); -- cgit v1.2.3 From 5a338d692aba7b8dcd682b96ed3f3e600187c176 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Thu, 14 Mar 2013 23:46:46 -0400 Subject: fix source path --- decoder/cdec_ff.cc | 2 +- decoder/ff_source_path.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'decoder/cdec_ff.cc') 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); ff_registry.Register("LexicalTranslationTrigger", new FFFactory); ff_registry.Register("WordPairFeatures", new FFFactory); - ff_registry.Register("SourthPathFeatures", new FFFactory); + ff_registry.Register("SourcePathFeatures", new FFFactory); ff_registry.Register("WordSet", new FFFactory); ff_registry.Register("Dwarf", new FFFactory); ff_registry.Register("External", new FFFactory); 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(ant_contexts[cur]); + cur = *reinterpret_cast(ant_contexts[-cur]); else FireUnigramFeature(cur, features); if (prev) FireBigramFeature(prev, cur, features); -- cgit v1.2.3