Back then we wanted to get our hands on the Github search engine(https://github.com/danlark1/sparse_ngrams) but it was not available, so we went a different way.
Instead of n-grams,`fmgrep` builds an FM index of the tree with O(pattern) `count` and O(occurrences) `locate`, which is quite cool and leads to blazing fast performance as seen in the benchmarks.