summaryrefslogtreecommitdiff
path: root/decoder/ff_wordalign.h
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2010-02-01 17:38:39 -0500
committerChris Dyer <redpony@gmail.com>2010-02-01 17:38:39 -0500
commitc97b8a8b58f7385fb48b74e2cf1ea9610cd1202f (patch)
tree3bc1b02c39927a810862136534d5a0e35d7ed4fc /decoder/ff_wordalign.h
parentda222df300e4f87ad185a7decbf119ad56aa34e0 (diff)
word aligner cleanup, new features
Diffstat (limited to 'decoder/ff_wordalign.h')
-rw-r--r--decoder/ff_wordalign.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/decoder/ff_wordalign.h b/decoder/ff_wordalign.h
index c5404887..688750de 100644
--- a/decoder/ff_wordalign.h
+++ b/decoder/ff_wordalign.h
@@ -19,7 +19,8 @@ class RelativeSentencePosition : public FeatureFunction {
private:
const int fid_;
bool condition_on_fclass_;
- std::string template_;
+ std::vector<std::vector<WordID> > pos_;
+ std::map<WordID, int> fids_; // fclass -> fid
};
class Model2BinaryFeatures : public FeatureFunction {
@@ -66,10 +67,14 @@ class MarkovJumpFClass : public FeatureFunction {
SparseVector<double>* features,
SparseVector<double>* estimated_features,
void* context) const;
- private:
- void FireFeature(WordID src,
- WordID trg,
+
+ void FireFeature(const SentenceMetadata& smeta,
+ int prev_src_pos,
+ int cur_src_pos,
SparseVector<double>* features) const;
+
+ private:
+ std::vector<std::map<WordID, std::map<int, int> > > fids_; // flen -> fclass -> jumpsize -> fid
std::vector<std::vector<WordID> > pos_;
};