diff --git a/src/optimizer.js b/src/optimizer.js
index 3a4b5c6..7d8e9f0 100644
--- a/src/optimizer.js
+++ b/src/optimizer.js
@@ -142,8 +142,12 @@ class PromptOptimizer {
// Remove filler words from text
- const fillers = ['just', 'really', 'very', 'actually'];
+ const fillers = ['just', 'really', 'very', 'actually',
+ 'basically', 'literally', 'honestly', 'perhaps',
+ 'maybe', 'probably', 'simply'];
for (const f of fillers) {
- text = text.replace(new RegExp(`\\b${f}\\b`, 'gi'), '');
+ text = text.replace(
+ new RegExp(`\\b${f}\\b\\s*`, 'gi'), ''
+ );
}
@@ -165,3 +169,8 @@ class PromptOptimizer {
+ telegraphCompress(text) {
+ return text.replace(/\b(the|a|an)\b/gi, '')
+ .replace(/\s{2,}/g, ' ')
+ .trim();
+ }
src/optimizer.js: 2 hunks, +13 -3
L142: expanded fillers list
(7 new: basically, literally, honestly,
perhaps, maybe, probably, simply)
+ regex now strips trailing whitespace
L169: added telegraphCompress()
strips articles (the/a/an), collapses spaces