The function seems to consistently apply its rule for location-based words. For other types of words, like objects or emotions, the rule does not hold as it returns "undefined."