summaryrefslogtreecommitdiff
path: root/decoder/ff_wordalign.cc
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2010-01-29 15:56:59 +0000
committerChris Dyer <redpony@gmail.com>2010-01-29 15:56:59 +0000
commitda222df300e4f87ad185a7decbf119ad56aa34e0 (patch)
tree1137deefefd28b1a89f6b2b339883801cc12cb29 /decoder/ff_wordalign.cc
parentee4383b3bc67e2d8ce113fce716050dc2e1b8572 (diff)
word aligner checkin
Diffstat (limited to 'decoder/ff_wordalign.cc')
-rw-r--r--decoder/ff_wordalign.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/decoder/ff_wordalign.cc b/decoder/ff_wordalign.cc
index c1b66a5e..e3fa91d4 100644
--- a/decoder/ff_wordalign.cc
+++ b/decoder/ff_wordalign.cc
@@ -84,6 +84,23 @@ void RelativeSentencePosition::TraversalFeaturesImpl(const SentenceMetadata& sme
// cerr << f_len_ << " " << e_len_ << " [" << edge.i_ << "," << edge.j_ << "|" << edge.prev_i_ << "," << edge.prev_j_ << "]\t" << edge.rule_->AsString() << "\tVAL=" << val << endl;
}
+MarkovJumpFClass::MarkovJumpFClass(const string& param) :
+ FeatureFunction(1) {
+ cerr << " MarkovJumpFClass" << endl;
+ cerr << "Reading source POS tags from " << param << endl;
+ ReadFile rf(param);
+ istream& in = *rf.stream();
+ while(in) {
+ string line;
+ getline(in, line);
+ if (line.empty()) continue;
+ vector<WordID> v;
+ TD::ConvertSentence(line, &v);
+ pos_.push_back(v);
+ }
+ cerr << " (" << pos_.size() << " lines)\n";
+}
+
MarkovJump::MarkovJump(const string& param) :
FeatureFunction(1),
fid_(FD::Convert("MarkovJump")),