// 统计文本中单词出现的频率 function countWords(text) { const words = text.toLowerCase().split(/\s+/); const wordCount = {}; for (const word of words) { const cleaned = word.replace(/[^a-z0-9
// 统计文本中单词出现的频率 function countWords(text) { const words = text.toLowerCase().split(/\s+/); const wordCount = {}; for (const word of words) { const cleaned = word.replace(/[^a-z0-9