summaryrefslogtreecommitdiff
path: root/extractor/run_extractor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'extractor/run_extractor.cc')
-rw-r--r--extractor/run_extractor.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/extractor/run_extractor.cc b/extractor/run_extractor.cc
index 00564a36..75fae627 100644
--- a/extractor/run_extractor.cc
+++ b/extractor/run_extractor.cc
@@ -33,6 +33,7 @@
#include "time_util.h"
#include "translation_table.h"
#include "vocabulary.h"
+#include "../utils/filelib.h"
namespace fs = boost::filesystem;
namespace po = boost::program_options;
@@ -42,7 +43,7 @@ using namespace features;
// Returns the file path in which a given grammar should be written.
fs::path GetGrammarFilePath(const fs::path& grammar_path, int file_number) {
- string file_name = "grammar." + to_string(file_number);
+ string file_name = "grammar." + to_string(file_number) + ".gz";
return grammar_path / file_name;
}
@@ -239,8 +240,8 @@ int main(int argc, char** argv) {
}
Grammar grammar = extractor.GetGrammar(
sentences[i], blacklisted_sentence_ids);
- ofstream output(GetGrammarFilePath(grammar_path, i).c_str());
- output << grammar;
+ WriteFile output(GetGrammarFilePath(grammar_path, i).c_str());
+ *output << grammar;
}
for (size_t i = 0; i < sentences.size(); ++i) {