Output ranks, Sort terms by frequency