Linguistic adaptation through iterated learning