Frequent words or phrases

The binary file Words is used to store lots of words or phrases, and many of them may have duplicates. Now, we need to find 100 words or phrase that appears most frequently. Because the memory amount is limited, only 1000 phrases can be computed each time at the most.

Solution:

A B C
1 =file("Words") =A1.cursor@b()
2 =B1.groupx(Words;count(~):Count;1000)  
3 =A2.sortx(-Count;1000)  
4 =A3.fetch(100)  
5 >A3.close()  

In A4, the retrieved result is shown below: