diff options
author | Paul Baltescu <pauldb89@gmail.com> | 2013-04-24 17:18:10 +0100 |
---|---|---|
committer | Paul Baltescu <pauldb89@gmail.com> | 2013-04-24 17:18:10 +0100 |
commit | ba206aaac1d95e76126443c9e7ccc5941e879849 (patch) | |
tree | 13a918da3f3983fd8e4cb74e7cdc3f5e1fc01cd1 /extractor | |
parent | c2aede0f19b7a5e43581768b8c4fbfae8b92c68c (diff) | |
parent | db960a8bba81df3217660ec5a96d73e0d6baa01b (diff) |
Merge branch 'master' of https://github.com/redpony/cdec
Diffstat (limited to 'extractor')
-rw-r--r-- | extractor/data_array.cc | 1 | ||||
-rw-r--r-- | extractor/suffix_array.cc | 4 |
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(); |