ngrams and search using them
Merged Uros changes.