daily pastebin goal
32%
SHARE
TWEET

Acceptable Words

Riizet Apr 22nd, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool is_alpha(char c)
  2. {
  3.     return !(isalpha(c) || c == '-');
  4. }
  5.  
  6. void Wordlist::acceptableWords()
  7. {
  8.     std::transform(words.begin(), words.end(), words.begin(),
  9.                    [](std::string & word)
  10.                    {
  11.                        bool qualifier = std::find_if(word.begin(), word.end(), is_alpha) == word.end();
  12.                        size_t i = word.find("--");
  13.                        if(qualifier && word.length() > 2 && i == std::string::npos)
  14.                            return word;
  15.                        else
  16.                            return word.erase(0);
  17.                    });
  18.     words.erase(std::remove(words.begin(),words.end(),""), words.end());
  19. }
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
 
Top