summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonetienne <leonetienne@hotmail.de>2022-02-12 03:58:39 +0100
committerLeonetienne <leonetienne@hotmail.de>2022-02-12 03:59:03 +0100
commit50ca78ee9021a09122e08810646dda71a620f15a (patch)
treecb027fd69709897163e64ff232569aff34c6512f
parent719051affc9dcf477e1e919f681538246ca0d1b1 (diff)
Impwuvd readabiwity for words containying "one"
-rw-r--r--main.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/main.cpp b/main.cpp
index fe48cd4..9bf8b2f 100644
--- a/main.cpp
+++ b/main.cpp
@@ -217,7 +217,7 @@ std::string MakeUwu(std::string boringString) {
boringString = ReplaceButKeepSigns(boringString, "dear", "hiiiiiii");
boringString = ReplaceButKeepSigns(boringString, "hi", "hiiiiiii");
- // Replace N with Ny, but only if succeeded by a vowel
+ // Replace N with Ny, but only if succeeded by a vowel, and not preceded by an o: "one" has such a niche pronunciation.
boringString = ReplaceButKeepSigns(
boringString,
"n",
@@ -227,8 +227,12 @@ std::string MakeUwu(std::string boringString) {
if (index + found.length() == boringString.length() - 1)
return false;
- // Only replace if the next char is a vowel
const char nextChar = MakeLower(boringString[index + found.length()]);
+ const char lastChar = MakeLower(boringString[index - 1]);
+
+ // Don't replace if the last char is an 'o'
+ if (lastChar == 'o')
+ return false;
// Is this a vowel?
if (IsVowel(nextChar))
@@ -253,7 +257,6 @@ std::string MakeUwu(std::string boringString) {
if (index == 0)
return false;
- // Only replace if the next char is a vowel
const char nextChar = MakeLower(boringString[index + found.length()]);
const char lastChar = MakeLower(boringString[index - 1]);