Skip to content

Commit

Permalink
Patch BP (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
JMMackenzie authored and amallia committed Jun 7, 2019
1 parent 5b4cacb commit 9e650ac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/recursive_graph_bisection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,15 @@ int main(int argc, char const *argv[])
fwd.clear();
documents.clear();
reorder_inverted_index(input_basename, output_basename, mapping);

if(documents_filename) {
auto documents = Payload_Vector<>::from(*documents_filename);
auto doc_buffer = Payload_Vector_Buffer::from_file(*documents_filename);
auto documents = Payload_Vector<std::string>(doc_buffer);
std::vector<std::string> reordered_documents(documents.size());
for (size_t i = 0; i < documents.size(); ++i) {
pisa::progress doc_reorder("Reordering documents vector", documents.size());
for (size_t i = 0; i < documents.size(); ++i) {
reordered_documents[mapping[i]] = documents[i];
doc_reorder.update(1);
}
encode_payload_vector(reordered_documents.begin(), reordered_documents.end()).to_file(*reordered_documents_filename);
}
Expand Down

0 comments on commit 9e650ac

Please sign in to comment.