Group lines/phrases based on frequency of common words