diff options
| author | Leonetienne <leonetienne@hotmail.de> | 2022-02-10 10:58:54 +0100 |
|---|---|---|
| committer | Leonetienne <leonetienne@hotmail.de> | 2022-02-10 10:59:00 +0100 |
| commit | 479f0d4d0d43d64ce6f3cb141acb9a91605a064f (patch) | |
| tree | fb334143b0126c602300bd9cb044227e5f2c7080 | |
| parent | 056382be9fb625bb6acefbfb3e2308db475a328f (diff) | |
Nyow wepwacing er-endings witw a
| -rw-r--r-- | main.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -224,7 +224,7 @@ std::string MakeUwu(std::string boringString) { "ny", [boringString](const std::string &found, int index) { // Don't replace, if we are on the last char - if (index == boringString.length() - 1) + if (index + found.length() == boringString.length() - 1) return false; // Only replace if the next char is a vowel @@ -246,7 +246,7 @@ std::string MakeUwu(std::string boringString) { "w", [boringString](const std::string &found, const std::size_t index) { // Don't replace, if we are on the last char - if (index == boringString.length()) + if (index + found.length() == boringString.length() - 1) return false; // Only replace if the next char is a vowel @@ -292,6 +292,24 @@ std::string MakeUwu(std::string boringString) { } ); + // Replace ER with A, but only if it's the last two letters of a word + boringString = ReplaceButKeepSigns( + boringString, + "er", + "a", + [boringString](const std::string &found, int index) { + // Replace if we're at the end of this line/segment + if (index + found.length() == boringString.length() - 1) + return false; + + // Fetch the next char + const char nextChar = MakeLower(boringString[index + found.length()]); + + // Replace if the next char is not a letter + return IsLetter(nextChar) == false; + } + ); + // Replace random punctuation with uwwwwu cute symbols // About evewy fifteenth symbol std::stringstream ss; |
