Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include <iostream>
- //#include <sstream>
- //
- //using namespace std;
- //
- //istringstream line_splitter(line);
- //return {istream_iterator<string>(line_splitter),=======}
- //
- //Stats ExploreLine(const set<string>&key_words,const string&line)
- //{
- // Stats result;
- // for (const string& word : Split(line))
- // {
- // if (key_words.count(word) > 0)
- // {
- // result.word_frequencies[word]++;
- // }
- // }
- // return result;
- //}
- //
- //
- //Stats ExploreKeyWordsSingleThread()
- //{
- // result += ExploreLine(key_words, line);
- // return result;
- //}
- //
- //Stats ExploreBatch(const set<string>& key_words, vector<string> lines)
- //{
- // Stats result;
- // for (const string& word : lines)
- // {
- //
- // result += ExploreLine(key_words, line);
- //
- // }
- // return result;
- //}
- //
- //Stats ExploreKeyWords(const set<string>& key_words, istream& input)
- //{
- // const size_t max_batch_size = 5000;
- //
- // vector<string> batch;
- // batch.reserve(max_batch_size);
- //
- // vector<future<Stats>> futures;
- //
- // for (string line; getline(input, line);)
- // {
- // batch.push_back(move(line));
- // if (batch.size() >= max_batch_size)
- // {
- // futures.push_back(async(ExploreBatch, ref(key_words), move()));
- // batch.reserve(max_batch_size);
- // }
- // }
- //}
- //
- //int main()
- //{
- // return 0;
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement