From f9859ad4116733e145d7b8eb31c3cc9318ff7564 Mon Sep 17 00:00:00 2001 From: "graehl@gmail.com" Date: Mon, 2 Aug 2010 07:57:23 +0000 Subject: fake tdict names for non-ids, push viterbi cost to root in hg, store as feature. type erased fsa feature via virtual interface. made lexical_cast assume C locale for speed. git-svn-id: https://ws10smt.googlecode.com/svn/trunk@465 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/tromble_loss.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'decoder/tromble_loss.cc') diff --git a/decoder/tromble_loss.cc b/decoder/tromble_loss.cc index 9ebd8ab1..24cfef5f 100644 --- a/decoder/tromble_loss.cc +++ b/decoder/tromble_loss.cc @@ -1,9 +1,9 @@ #include "tromble_loss.h" +#include "fast_lexical_cast.hpp" #include #include #include -#include #include #include #include @@ -170,7 +170,7 @@ class TrombleLossComputerImpl { size_t StateSize() const { // n-1 boundary words plus counts for n-grams currently rendered as bytes even though most would fit in bits. - // Also, this is cached by higher up classes so no need to cache here. + // Also, this is cached by higher up classes so no need to cache here. return MutableState::Size(thetas_.size(), bound_ngram_id_); } @@ -179,8 +179,8 @@ class TrombleLossComputerImpl { const TRule &rule, const vector &ant_contexts, void *out_context) const { - // TODO: get refs from sentence metadata. - // This will require resizable features. + // TODO: get refs from sentence metadata. + // This will require resizable features. if (smeta.GetSentenceID() >= ref_ids_.size()) { std::cerr << "Sentence ID " << smeta.GetSentenceID() << " doesn't have references; there are only " << ref_ids_.size() << " references." << std::endl; exit(1); @@ -216,7 +216,7 @@ class TrombleLossComputerImpl { if (++pushed == keep) { std::copy(history.begin(), history.end(), out_state.left); } - // Now i is the length of the history coming from this constituent. So it needs at least i+1 words to have a cross-child add. + // Now i is the length of the history coming from this constituent. So it needs at least i+1 words to have a cross-child add. AddWord(history, i + 1, ngrams, out_state.counts); } // If the consituent is shorter than thetas_.size(), then the -- cgit v1.2.3