summaryrefslogtreecommitdiff
path: root/decoder/ff_source_syntax2.cc
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2013-11-05 18:15:18 +0100
committerPatrick Simianer <p@simianer.de>2013-11-05 18:15:18 +0100
commita7a0773b0e299f71409cf4a13d18ea7db5ab3fc1 (patch)
treea7c570f748480fd17c82e82163d1c2dbd5315a3f /decoder/ff_source_syntax2.cc
parent5a23ee2ae792b629e0f52b9c7fdf293de60a0ca1 (diff)
syntax features now read trees from files -- no more escaping!
Diffstat (limited to 'decoder/ff_source_syntax2.cc')
-rw-r--r--decoder/ff_source_syntax2.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/decoder/ff_source_syntax2.cc b/decoder/ff_source_syntax2.cc
index 63736342..9d0bc33f 100644
--- a/decoder/ff_source_syntax2.cc
+++ b/decoder/ff_source_syntax2.cc
@@ -90,7 +90,7 @@ struct SourceSyntaxFeatures2Impl {
const WordID lhs = src_tree(i,j);
int& fid_ef = fids_ef(i,j)[&rule];
ostringstream os;
- os << "SYN:" << TD::Convert(lhs);
+ os << "SSYN2:" << TD::Convert(lhs);
os << ':';
unsigned ntc = 0;
for (unsigned k = 0; k < rule.f_.size(); ++k) {
@@ -159,6 +159,9 @@ void SourceSyntaxFeatures2::TraversalFeaturesImpl(const SentenceMetadata& smeta,
}
void SourceSyntaxFeatures2::PrepareForInput(const SentenceMetadata& smeta) {
- impl->InitializeGrids(smeta.GetSGMLValue("src_tree"), smeta.GetSourceLength());
+ ReadFile f = ReadFile(smeta.GetSGMLValue("src_tree"));
+ string tree;
+ f.ReadAll(tree);
+ impl->InitializeGrids(tree, smeta.GetSourceLength());
}