Group all word pairs in a text file. Used for performance test and compare.