I think that is where people disagree about the definition of AI.
An algorithm isn't really AI then. Something worthy of being called AI should be capable of this understanding and judgement.