either take a new stream or store the words in vector of strings in previous loop
istringstream iss2 ( s ) ; while ( getline ( iss2 , token , ' ▁ ' ) ) { int count = setOfWords [ token ] ; if ( count > 1 ) { return token ; } } return " NoRepetition " ; }