summaryrefslogtreecommitdiff
path: root/decoder/tromble_loss.cc
diff options
context:
space:
mode:
authorgraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-02 07:57:23 +0000
committergraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-02 07:57:23 +0000
commitf9859ad4116733e145d7b8eb31c3cc9318ff7564 (patch)
tree92f6942fc7fd7066eb400bce6d2cbd2fee46c801 /decoder/tromble_loss.cc
parent6da285dfa7b0a1929dcec882d7e48a585e878d18 (diff)
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
Diffstat (limited to 'decoder/tromble_loss.cc')
-rw-r--r--decoder/tromble_loss.cc10
1 files changed, 5 insertions, 5 deletions
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 <boost/algorithm/string/predicate.hpp>
#include <boost/circular_buffer.hpp>
#include <boost/functional/hash.hpp>
-#include <boost/lexical_cast.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/tokenizer.hpp>
#include <boost/unordered_map.hpp>
@@ -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<const void*> &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