Works with arbitrary <n>gram