This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

Revert "limit word count"

This reverts commit 96a066512572e45f3b53295cd3b42c371b9cb30e.

+23 -7
+23 -7
src/wolf-noise-generator.ts
··· 47 47 const randomWords = wolfNoises[category]; // Get words for the selected category 48 48 49 49 let result = ""; 50 + let currentSentenceLength = 0; 51 + 52 + // Determine whether to generate a shorter post, longer post, or very short post 53 + const shorterPostProbability = 0.7; // 70% chance of generating a shorter or very short post 54 + const generateShorterOrVeryShortPost = Math.random() < shorterPostProbability; 50 55 let maxLength; 51 56 52 - if (category === "howl") { 53 - // For howl, limit to 1 word only 54 - maxLength = 10; // Assuming an average word length of 10 characters 57 + if (generateShorterOrVeryShortPost) { 58 + // Determine whether to generate a very short post (1-5 words) or a shorter post (up to 140 or 280 characters) 59 + const veryShortPostProbability = 0.3; // 30% chance of generating a very short post 60 + const generateVeryShortPost = Math.random() < veryShortPostProbability; 61 + 62 + if (generateVeryShortPost) { 63 + // Generate a very short post (1-5 words) 64 + const wordCount = getRandomInt(1, 5); 65 + maxLength = wordCount * 10; // Assuming an average word length of 10 characters 66 + } else { 67 + // Generate a shorter post (up to 140 or 280 characters) 68 + maxLength = getRandomInt(70, 140); // For shorter post 69 + // maxLength = getRandomInt(140, 280); // For longer post 70 + } 55 71 } else { 56 - // For other categories, limit to 3-9 words 57 - const wordCount = getRandomInt(3, 9); 58 - maxLength = wordCount * 10; // Assuming an average word length of 10 characters 72 + // Generate a longer post (up to 280 characters) 73 + maxLength = 280; 59 74 } 60 75 61 76 while (result.length < maxLength) { ··· 69 84 result += " "; 70 85 } 71 86 result += randomWord; 87 + currentSentenceLength += wordLength; 72 88 } else { 73 89 // Break the loop if adding the word would exceed the maximum length 74 90 break; ··· 88 104 } 89 105 90 106 return result.trim(); // Remove any leading/trailing whitespace 91 - } 107 + }