summaryrefslogtreecommitdiff
path: root/extractor
diff options
context:
space:
mode:
Diffstat (limited to 'extractor')
-rw-r--r--extractor/data_array.cc1
-rw-r--r--extractor/suffix_array.cc4
2 files changed, 4 insertions, 1 deletions
diff --git a/extractor/data_array.cc b/extractor/data_array.cc
index 481abb80..203fe219 100644
--- a/extractor/data_array.cc
+++ b/extractor/data_array.cc
@@ -119,6 +119,7 @@ int DataArray::GetSentenceId(int position) const {
}
void DataArray::WriteBinary(const fs::path& filepath) const {
+ std::cerr << "File: " << filepath.string() << std::endl;
WriteBinary(fopen(filepath.string().c_str(), "w"));
}
diff --git a/extractor/suffix_array.cc b/extractor/suffix_array.cc
index 9988b1a2..65b2d581 100644
--- a/extractor/suffix_array.cc
+++ b/extractor/suffix_array.cc
@@ -1,5 +1,6 @@
#include "suffix_array.h"
+#include <cassert>
#include <chrono>
#include <iostream>
#include <string>
@@ -186,7 +187,8 @@ shared_ptr<DataArray> SuffixArray::GetData() const {
}
void SuffixArray::WriteBinary(const fs::path& filepath) const {
- FILE* file = fopen(filepath.string().c_str(), "r");
+ FILE* file = fopen(filepath.string().c_str(), "w");
+ assert(file);
data_array->WriteBinary(file);
int size = suffix_array.size();