summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorWu, Ke <wuke@cs.umd.edu>2014-12-06 10:37:56 -0500
committerWu, Ke <wuke@cs.umd.edu>2014-12-06 10:37:56 -0500
commitf690860fab19bf7ce48861368f0c7e868e50d3a1 (patch)
treea23a7791002eee10a4027260af9e6487d7f83700 /decoder
parent4444b842ef12f31e3aede13950b553f9a5bcb2d6 (diff)
parente39742355186ebf59a369b2e5b369648047ca216 (diff)
Merge branch 'const_reorder' into softsyn
Diffstat (limited to 'decoder')
-rw-r--r--decoder/ff_const_reorder.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/decoder/ff_const_reorder.cc b/decoder/ff_const_reorder.cc
index c0269125..8da551c6 100644
--- a/decoder/ff_const_reorder.cc
+++ b/decoder/ff_const_reorder.cc
@@ -1,5 +1,6 @@
#include "ff_const_reorder.h"
+#include "filelib.h"
#include "stringlib.h"
#include "hg.h"
#include "sentence_metadata.h"
@@ -383,13 +384,13 @@ struct SIndexMap {
index_map_parse_2_input = NULL;
return;
}
- STxtFileReader* reader = new STxtFileReader(index_map_file.c_str());
- char szLine[10001];
- szLine[0] = '\0';
- reader->fnReadNextLine(szLine, NULL);
- delete reader;
vector<string> terms;
- SplitOnWhitespace(string(szLine), &terms);
+ {
+ ReadFile file(index_map_file);
+ string line;
+ assert(getline(*file.stream(), line));
+ SplitOnWhitespace(line, &terms);
+ }
index_map_input_2_parse = new short int[terms.size() + 1];
int ix = 0;