init n-gram generator