quadgram term frequency generation