The function appears to work correctly for all the inputs I tested, but I did notice that it seems to prefer words that are proper nouns or names of specific things, such as "Ankara", "The Barber of Seville", "Stonehenge", and "López Obrador". It may not work as well with more abstract words or phrases.

I hope this helps! Let me know if you have any other questions or if you would like me to run more tests.