Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
查找单个单词趋势很简单,您可以将数据流的每个单词分块并进行计数并将其限制在最后 24 小时或 48 小时。我不确定如何找到 2 词或 3 词组合的趋势?任何帮助都是值得的
所以你有一些东西 - 对于单个单词的情况 - 说明了以下内容:
while (true) word = readNextWord() register(word, now) discardWordsOlderThan (now - windowSize)
只需跟踪上一个单词:
while (true) word = readNextWord() register(prev + " " + word, now) prev = word discardWordsOlderThan (now - windowSize)