AlexSSH

Untitled

Feb 17th, 2023
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. const auto query = ParseQuery(raw_query);
  2. vector<string_view> matched_words;
  3. for (const auto &word: query.plus_words) {
  4.     if (word_to_document_freqs_.at(word).count(document_id)) {
  5.         matched_words.push_back(word);
  6.     }
  7. ...
  8. }
  9.  
  10. //----------------------------------
  11.  
  12.     struct Query {
  13.         std::set<std::string> plus_words;
  14.         std::set<std::string> minus_words;
  15.     };
  16.  
  17.     struct QueryVector {
  18.         std::vector<std::string> plus_words;
  19.         std::vector<std::string> minus_words;
  20.     };
Advertisement
Add Comment
Please, Sign In to add comment