Analyzing manuscript and generating story names...
Generated Story Names:
function extractKeywords(text) {
// Keyword extraction logic
const commonWords = new Set(['the', 'and', 'of', 'in', 'a', 'to', 'is', 'that', 'with', 'it', 'as', 'for', 'was', 'on', 'at', 'by', 'an', 'this', 'which']);
const words = text.toLowerCase().split(/[^a-zA-Z]+/);
const wordCounts = {};
words.forEach(word => {
if (word.length > 3 && !commonWords.has(word)) {
wordCounts[word] = (wordCounts[word] || 0) + 1;
}
});
const sortedKeywords = Object.entries(wordCounts)
.sort((a, b) => b[1] - a[1])
.slice(0, 5) // Top 5 keywords
.map(entry => entry[0]);
return sortedKeywords;
}
function generateDynamicTitle(keyword1, keyword2) {
const structures = [
`The ${keyword1} and the ${keyword2}`,
`Chronicles of ${keyword1} and ${keyword2}`,
`The Rise of ${keyword1}`,
`${keyword1}: A Tale of ${keyword2}`,
`In the Shadow of ${keyword1}`,
`${keyword1} and the Secrets of ${keyword2}`,
`The Legacy of ${keyword1}`,
`${keyword2}: The ${keyword1} Prophecy`
];
return structures[Math.floor(Math.random() * structures.length)];
}
function generateStoryNames() {
const manuscriptText = document.getElementById('manuscriptText').value.trim();
const loadingMessage = document.getElementById('loadingMessage');
const errorMessage = document.getElementById('errorMessage');
const storyNameOutput = document.getElementById('storyNameOutput');
const storyNameList = document.getElementById('storyNameList');
// Clear previous messages and outputs
errorMessage.style.display = 'none';
storyNameOutput.style.display = 'none';
storyNameList.innerHTML = '';
if (!manuscriptText) {
errorMessage.textContent = 'Please enter your manuscript text.';
errorMessage.style.display = 'block';
return;
}
// Display loading message
loadingMessage.style.display = 'block';
setTimeout(() => {
try {
// Extract keywords from the manuscript
const keywords = extractKeywords(manuscriptText);
if (keywords.length === 0) {
throw new Error('No significant keywords found.');
}
// Generate multiple meaningful story names based on the top keywords
const storyNames = [];
for (let i = 0; i < keywords.length - 1; i++) {
for (let j = i + 1; j {
const listItem = document.createElement('li');
listItem.textContent = name;
storyNameList.appendChild(listItem);
});
storyNameOutput.style.display = 'block';
loadingMessage.style.display = 'none';
} catch (error) {
loadingMessage.style.display = 'none';
errorMessage.textContent = 'Failed to generate story names. Please ensure your text has meaningful content.';
errorMessage.style.display = 'block';
}
}, 1000); // Simulate processing delay
}
AI Hanaz Writers version 1.0 is currently available. Version 2.0, a more advanced and purchasable upgrade, is currently being designed and prepared.
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.