diff options
author | Patrick Simianer <p@simianer.de> | 2013-06-24 14:40:07 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2013-06-24 14:40:07 +0200 |
commit | e547ab5f765c72ad326b1d3a79f26bb221364d7d (patch) | |
tree | e205609de0adce98bdf4ec4e799cd776cebe8b72 /extractor/precomputation.cc | |
parent | becb1347773ebaae8cab2669afe4bad048cda992 (diff) | |
parent | 5794c0109902cf19a52cc8f1799353270ed9d85d (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'extractor/precomputation.cc')
-rw-r--r-- | extractor/precomputation.cc | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/extractor/precomputation.cc b/extractor/precomputation.cc index ee4ba42c..3b8aed69 100644 --- a/extractor/precomputation.cc +++ b/extractor/precomputation.cc @@ -165,25 +165,12 @@ void Precomputation::AddStartPositions( positions.push_back(pos3); } -void Precomputation::WriteBinary(const fs::path& filepath) const { - FILE* file = fopen(filepath.string().c_str(), "w"); - - // TODO(pauldb): Refactor this code. - int size = collocations.size(); - fwrite(&size, sizeof(int), 1, file); - for (auto entry: collocations) { - size = entry.first.size(); - fwrite(&size, sizeof(int), 1, file); - fwrite(entry.first.data(), sizeof(int), size, file); - - size = entry.second.size(); - fwrite(&size, sizeof(int), 1, file); - fwrite(entry.second.data(), sizeof(int), size, file); - } -} - const Index& Precomputation::GetCollocations() const { return collocations; } +bool Precomputation::operator==(const Precomputation& other) const { + return collocations == other.collocations; +} + } // namespace extractor |