alpha
Login
or
Join now
ewancroft.uk
/
bluesky-awoo-bot
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
added extra punctuation logic.
author
Ewan Croft
date
2 years ago
(May 23, 2024, 8:28 PM +0100)
commit
d330aee7
d330aee752767456816766af99c97b6c1c1a429c
parent
1e916059
1e916059b82e965763ff9af48f88fc14ca3c2155
+11
-3
1 changed file
Expand all
Collapse all
Unified
Split
src
wolf-noise-generator.ts
+11
-3
src/wolf-noise-generator.ts
Reviewed
···
98
98
wolfNoises.punctuation[category].length > 0
99
99
) {
100
100
const punctuationLength = wolfNoises.punctuation[category].length;
101
101
-
const randomPunctuation =
102
102
-
wolfNoises.punctuation[category][getRandomInt(0, punctuationLength - 1)];
103
103
-
result += randomPunctuation;
101
101
+
102
102
+
// Check if there's already punctuation at the end
103
103
+
const hasPunctuation = result.length > 0 && /[?!.]$/.test(result);
104
104
+
105
105
+
if (!hasPunctuation) {
106
106
+
const randomPunctuation =
107
107
+
wolfNoises.punctuation[category][
108
108
+
getRandomInt(0, punctuationLength - 1)
109
109
+
];
110
110
+
result += randomPunctuation;
111
111
+
}
104
112
}
105
113
106
114
return result.trim(); // Remove any leading/trailing whitespace