It can't be that simple because on most companion charts that I've read, a companion can "like OR dislike" a courting gift, not just "like" or "dislike". There must be something that determines this and, to me, the logical answer is to enter a relationship with the character.