summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorLeonetienne <leonetienne@hotmail.de>2022-02-10 10:58:54 +0100
committerLeonetienne <leonetienne@hotmail.de>2022-02-10 10:59:00 +0100
commit479f0d4d0d43d64ce6f3cb141acb9a91605a064f (patch)
treefb334143b0126c602300bd9cb044227e5f2c7080 /main.cpp
parent056382be9fb625bb6acefbfb3e2308db475a328f (diff)
Nyow wepwacing er-endings witw a
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 8c50960..6433b01 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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;