From 9986bc8fe11435b2134350bba24aa0139d2665ac Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Fri, 22 Apr 2011 13:38:32 -0400 Subject: make compatible with FastSparseVector --- extools/extract.cc | 4 ++-- extools/sg_lexer.l | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'extools') diff --git a/extools/extract.cc b/extools/extract.cc index a9de142e..f6c121b4 100644 --- a/extools/extract.cc +++ b/extools/extract.cc @@ -105,8 +105,8 @@ void Extract::LoosenPhraseBounds(const AnnotatedParallelSentence& sentence, const int ilim = min(i2_max, i1 + max_base_phrase_size); for (int i2 = max(i1+1,i2_min); i2 <= ilim; ++i2) { for (int j1 = j1_min; j1 <= j1_max; ++j1) { - const int jlim = min(j2_max, j1 + max_base_phrase_size); - for (int j2 = max(j1+1, j2_min); j2 <= jlim; ++j2) { + const int jlim = std::min(j2_max, j1 + max_base_phrase_size); + for (int j2 = std::max(j1+1, j2_min); j2 <= jlim; ++j2) { bool& seen = marker[i1][i2][j1][j2]; if (!seen) phrases->push_back(ParallelSpan(i1,i2,j1,j2)); diff --git a/extools/sg_lexer.l b/extools/sg_lexer.l index d60bd0fc..c85cdea7 100644 --- a/extools/sg_lexer.l +++ b/extools/sg_lexer.l @@ -240,7 +240,7 @@ ALIGN [0-9]+-[0-9]+ } {REAL} { // std::cerr << "Feature val input: " << yytext << std::endl; - cur_stats->counts[sglex_cur_fid] += strtod(yytext, NULL); + cur_stats->counts.add_value(sglex_cur_fid, strtod(yytext, NULL)); BEGIN(FEATS); } . { -- cgit v1.2.3