diff options
author | Wu, Ke <wuke@cs.umd.edu> | 2014-12-06 10:37:56 -0500 |
---|---|---|
committer | Wu, Ke <wuke@cs.umd.edu> | 2014-12-06 10:37:56 -0500 |
commit | 41bf2308139d08c992a3342154d1c8b96b44f681 (patch) | |
tree | a4e3bd820b4923151299588d74ed256d4e65472c /decoder/ff_const_reorder.cc | |
parent | 34b7c1e7c3aa5f9ee780be65effc40726d849303 (diff) | |
parent | a21959213f9b1cc15befae52dbb5091e848de7a1 (diff) |
Merge branch 'const_reorder' into softsyn
Diffstat (limited to 'decoder/ff_const_reorder.cc')
-rw-r--r-- | decoder/ff_const_reorder.cc | 13 |
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; |