Cost Segregation Real Estate Calculator

Professional SEO Content Analyzer

Word Count
0
Reading Time
0 min
Characters
0

Top Keyword Density

Keyword Occurrences Density
function analyzeSeoContent() { var text = document.getElementById('seo-input-text').value; var resultsArea = document.getElementById('seo-results-area'); if (!text.trim()) { alert('Please enter some text to analyze.'); return; } resultsArea.style.display = 'block'; // Basic Stats var words = text.toLowerCase().match(/\b\w+\b/g) || []; var wordCount = words.length; var charCount = text.length; var readingTime = Math.ceil(wordCount / 225); document.getElementById('res-word-count').innerText = wordCount; document.getElementById('res-char-count').innerText = charCount; document.getElementById('res-read-time').innerText = readingTime + ' min'; // Keyword Density Logic var stopWords = ['the', 'and', 'a', 'to', 'of', 'in', 'is', 'it', 'for', 'with', 'that', 'on', 'as', 'at', 'this', 'by', 'an', 'be', 'or', 'are', 'from', 'was']; var freqMap = {}; for (var i = 0; i 2 && stopWords.indexOf(word) === -1) { freqMap[word] = (freqMap[word] || 0) + 1; } } var sortedKeywords = []; for (var key in freqMap) { sortedKeywords.push([key, freqMap[key]]); } sortedKeywords.sort(function(a, b) { return b[1] – a[1]; }); var topKeywords = sortedKeywords.slice(0, 10); var tbody = document.getElementById('keyword-density-body'); tbody.innerHTML = "; for (var j = 0; j < topKeywords.length; j++) { var kw = topKeywords[j][0]; var count = topKeywords[j][1]; var density = ((count / wordCount) * 100).toFixed(2) + '%'; var row = document.createElement('tr'); row.style.borderBottom = '1px solid #eee'; row.innerHTML = '' + kw + '' + '' + count + '' + '' + density + ''; tbody.appendChild(row); } resultsArea.scrollIntoView({ behavior: 'smooth' }); }

Leave a Comment