What is the tree (trie?) structure and sorting-and-aggregating that you mean?
The tree structure: Put all the unique words into a tree. You could use a trie, but considering how dense the tree is likely to end up, a traditional split-26-ways-on-each-byte tree would probably work just as well.
The sorting-and-aggregating option: Run a traditional mergesort, but attach counters (initialized to 1) to each word; and every time you find yourself comparing two identical words, replace them by a single record with the sum of the counters.
Assuming the corpus is not too big, the solution can be thrown together in Python in a few minutes.
This code processes 12Mb of text in less than 5 seconds on my laptop.