On how learning mechanisms shape natural languages