compares query n-grams to find similar n-grams in a corpus, using string distances