SHARE
TWEET

Untitled

a guest Jan 24th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. map<string, int> text;
  2. map<int, vector<string>, cmpDec> freq;
  3.    
  4. while (rf >> words) {
  5.     text[words]++;
  6. }
  7.    
  8. map<string, int>::iterator iter_map1 = text.begin();
  9. map<int, vector<string>>::iterator iter = freq.begin();
  10. vector<string>::iterator iter_v;
  11. for (; iter_map1 != text.end(); ++iter_map1) {
  12.    iter->first.insert(make_pair(iter_map1->second, iter->second.push_back(iter_map1->first)));
  13. }
  14.    
  15. ...BagOfWords.cpp|56|error: request for member 'insert' in 'iter.std::_Rb_tree_iterator<_Tp>::operator-><std::pair<const int, std::vector<std::__cxx11::basic_string<char> > > >()->std::pair<const int, std::vector<std::__cxx11::basic_string<char> > >::first', which is of non-class type 'const int'|
  16.    
  17. iter->first.insert(...
  18.    
  19. freq[iter_map1->second].push_back(iter_map1->first);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top