N-Gram based search machine