Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const auto query = ParseQuery(raw_query);
- vector<string_view> matched_words;
- for (const auto &word: query.plus_words) {
- if (word_to_document_freqs_.at(word).count(document_id)) {
- matched_words.push_back(word);
- }
- ...
- }
- //----------------------------------
- struct Query {
- std::set<std::string> plus_words;
- std::set<std::string> minus_words;
- };
- struct QueryVector {
- std::vector<std::string> plus_words;
- std::vector<std::string> minus_words;
- };
Advertisement
Add Comment
Please, Sign In to add comment