diff options
author | Hieu Hoang <fishandfrolick@gmail.com> | 2013-06-14 21:34:47 +0400 |
---|---|---|
committer | Hieu Hoang <fishandfrolick@gmail.com> | 2013-06-14 21:34:47 +0400 |
commit | f7371cf53d026b9394d02f70e3325570d878da1a (patch) | |
tree | 5e7073909b66432e2afd838c9e8d270c851104ee /moses/TranslationOptionCollectionConfusionNet.cpp | |
parent | 0d6565b9a584d3df8b5098538267cbf6acffdd4b (diff) |
calculate m_featuresToApply in Load() for PhraseDictionary. Since every phrase dictionary now has to implement it, make Load() for PhraseDictionary abstract
Diffstat (limited to 'moses/TranslationOptionCollectionConfusionNet.cpp')
-rw-r--r-- | moses/TranslationOptionCollectionConfusionNet.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/moses/TranslationOptionCollectionConfusionNet.cpp b/moses/TranslationOptionCollectionConfusionNet.cpp index c09fafab7..aca05b4f6 100644 --- a/moses/TranslationOptionCollectionConfusionNet.cpp +++ b/moses/TranslationOptionCollectionConfusionNet.cpp @@ -40,29 +40,29 @@ TranslationOptionCollectionConfusionNet::TranslationOptionCollectionConfusionNet // cut up confusion network into substrings // start with 1-word phrases - std::vector<SourcePath> &subphrases = GetPhrases(startPos, startPos); - assert(subphrases.size() == 0); + std::vector<SourcePath> &subphrases = GetPhrases(startPos, startPos); + assert(subphrases.size() == 0); - const ConfusionNet::Column &col = input.GetColumn(startPos); - ConfusionNet::Column::const_iterator iter; - for (iter = col.begin(); iter != col.end(); ++iter) { - subphrases.push_back(SourcePath()); - SourcePath &sourcePath = subphrases.back(); + const ConfusionNet::Column &col = input.GetColumn(startPos); + ConfusionNet::Column::const_iterator iter; + for (iter = col.begin(); iter != col.end(); ++iter) { + subphrases.push_back(SourcePath()); + SourcePath &sourcePath = subphrases.back(); - const std::pair<Word,std::vector<float> > &inputNode = *iter; + const std::pair<Word,std::vector<float> > &inputNode = *iter; - //cerr << "word=" << inputNode.first << " scores=" << inputNode.second.size() << endl; - sourcePath.first.AddWord(inputNode.first); - sourcePath.second.PlusEquals(inputFeature, inputNode.second); + //cerr << "word=" << inputNode.first << " scores=" << inputNode.second.size() << endl; + sourcePath.first.AddWord(inputNode.first); + sourcePath.second.PlusEquals(inputFeature, inputNode.second); - } + } } - for (size_t startPos = 0; startPos < input.GetSize(); ++startPos) { - for (size_t endPos = startPos; endPos < input.GetSize(); ++endPos) { + for (size_t startPos = 0; startPos < input.GetSize(); ++startPos) { + for (size_t endPos = startPos; endPos < input.GetSize(); ++endPos) { - } - } + } + } } |