summaryrefslogtreecommitdiff
path: root/extractor/suffix_array.cc
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-04-24 17:18:10 +0100
committerPaul Baltescu <pauldb89@gmail.com>2013-04-24 17:18:10 +0100
commite8b412577b9d3fe2090b9f48443f919cd268c809 (patch)
treeb46a7b51d365519dfb5170d71bac33be6d3e29b9 /extractor/suffix_array.cc
parentd189426a7ea56b71eb6e25ed02a7b0993cfb56a8 (diff)
parent5aee54869aa19cfe9be965e67a472e94449d16da (diff)
Merge branch 'master' of https://github.com/redpony/cdec
Diffstat (limited to 'extractor/suffix_array.cc')
-rw-r--r--extractor/suffix_array.cc4
1 files changed, 3 insertions, 1 deletions
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();