1

単一の単語の傾向を見つけるのは簡単です。データ ストリームの各単語をチャンクし、カウントを行い、過去 24 時間または 48 時間で制限できます。2 語または 3 語の組み合わせの傾向を見つける方法がわかりません。どんな助けでも感謝します

4

1 に答える 1

0

So you've got something - for the single-word case - that says something along the lines of:

while (true)
    word = readNextWord()
    register(word, now)
    discardWordsOlderThan (now - windowSize)

Just keep track of the previous word:

while (true)
    word = readNextWord()
    register(prev + " " + word, now)
    prev = word
    discardWordsOlderThan (now - windowSize)
于 2009-06-16T21:39:00.147 に答える