summaryrefslogtreecommitdiff
path: root/extractor
diff options
context:
space:
mode:
Diffstat (limited to 'extractor')
-rw-r--r--extractor/Makefile.am2
-rw-r--r--extractor/run_extractor.cc7
2 files changed, 5 insertions, 4 deletions
diff --git a/extractor/Makefile.am b/extractor/Makefile.am
index a406d9dc..cdfbb307 100644
--- a/extractor/Makefile.am
+++ b/extractor/Makefile.am
@@ -115,7 +115,7 @@ noinst_LIBRARIES = libextractor.a
sacompile_SOURCES = sacompile.cc
sacompile_LDADD = libextractor.a
run_extractor_SOURCES = run_extractor.cc
-run_extractor_LDADD = libextractor.a
+run_extractor_LDADD = libextractor.a ../utils/libutils.a
extract_SOURCES = extract.cc
extract_LDADD = libextractor.a
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) {