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 | e8b412577b9d3fe2090b9f48443f919cd268c809 (patch) | |
tree | b46a7b51d365519dfb5170d71bac33be6d3e29b9 /extractor | |
parent | d189426a7ea56b71eb6e25ed02a7b0993cfb56a8 (diff) | |
parent | 5aee54869aa19cfe9be965e67a472e94449d16da (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(); |