Friday, August 30, 2024

Famous name with 8 letters but only 1 consonant

Hi Puzzlers, have you solved this week's Sunday Puzzle from NPR yet?

This week's challenge comes from listener Lillian Range, of New Orleans. The word NONUNION has four N's and no other consonant. What famous American of the past -- first and last names, 8 letters in all -- has four instances of the same consonant and no other consonant?

Clearly, this one is going to be light on the NLP side of things. All we really need here is a long enough list of famous Americans and a few python functions to iterate through them.

I've scraped together a list of 10,000 famous names, which has proven adequate. [A caveat--my list is noisy, has been cleaned with some automated functions which ASCII-fy everything, so diacritics are removed, spellings may get broken, etc. And on top of that, there are lots of non-American names and I even noticed some fictional characters. This is a bootstrapped list and I wouldn't necessarily rely on it for future puzzles.]

I also wrote a little python script to read in each name, keep only those that are 8 letters total, and finally print out any names that have only 1 consonant with exactly 4 instances (in data science terms-- 1 type, 4 tokens). I've got it printing out the correct name now. Feel free to download the script and list and try it yourself.

Or now that the Thursday deadline has passed, you can see my solution below:


See you at the next puzzle!

Sunday, August 18, 2024

An actor and a profession

It's Sunday, Puzzlers, and you know that that means---it's time to solve this week's Sunday Puzzle from NPR:

This week's challenge comes from listener Peter Collins, of Ann Arbor, Michigan. Think of a famous movie star -- first and last names, nine letters in all. The third, fourth, fifth, seventh, and eighth letters, in order, name a profession. The star's last name is something that this profession uses. Who is the movie star and what is the profession?


Classic, easy-peasy transformation puzzle, right? We take thing from Class A, apply the prescribed transformation, and return thing from Class B. Quite similar to last week's puzzle, really. So what do we need to solve this one?

  • Actors:
    • We need a list of actors; fortunately this is a common element in puzzles, so we can use this list of actors from previous puzzles.
  • Professions:
    • Ideally, we'd check to see if the specified transformation gives us a string that's found in a list of professions. I think this is going to be overkill, however. I suspect that if we simply check to see if the resulting string is a real word, that will reduce the number of candidates down to a number that we can quickly scan visually in order to find the solution. In fact, this may give us the solution only and no other candidates. So, we need:
  • transformation:
    • I'll be using python to implement the transformation where we extract the five letters from the specified positions
Does this approach make sense to you? Would you go a step further and use some semantic tools like LMs  or embeddings to compare the transformed strings against a list of professions? Do you think this approach is adequate?

I think my approach is working. If you'd like to explore it, I'm sharing my python script as usual on GitHub. I'll be back after NPR's Thursday deadline to share my solution. Good luck!
-- (Puzzle Dr.) Levi King

Update

The Thursday deadline has passed, so here's my solution: 


See you next week!

Tuesday, August 13, 2024

A food transformed

 Hi Puzzlers! Let's take a shot at this week's Sunday Puzzle from NPR.

This week's challenge comes from listener Greg VanMechelen, of Berkeley, Calif. Think of a popular food item in six letters. Change the last two letters to a K to make a common five-letter word in which none of the letters are pronounced the same as in the six-letter food. What food is this?

Ah, a classic transformation puzzle-- take a thing from Class A, apply the given transformation, return a thing from Class B. We've done this a million times! Let's break it down.

We need:

  • A list of food words:
    • Foods are a common puzzle theme, so we can simply reuse the food lexicon we created for previous puzzles, here.
    • We'll filter this list down to 6-letter words.
  • An English lexicon:
    • After we apply the transformation, we'll need to check if the resulting string is a real word.
    • Here's a lexicon of 10k words we've scraped and cobbled together for previous puzzles.
  • A script with the following functions:
    • load lexicons from text files (i.e., food lexicon & general English lexicon);
    • filter the lexicons to 6-letters and 5-letters respectively;
    • iterate through the food lexicon and:
      • transform spelling (replace last two letters of food word with "k");
      • check English lexicon for transformed string;
      • print original string and new string (if new string is in English lexicon);
But wait--what about the pronunciation bit? We certainly could do this easily enough using a pronunciation dictionary, as we did with the CMU pronunciation dictionary for this puzzle, for example. However, I think it would be overkill. I'm confident that the number of candidate pairs where we have a food word that is transformed into a real English word is going to be so small that we can easily pick the correct solution from the results. In fact, there may only be one candidate pair--we'll find out soon!

I've whipped up a script as described above; feel free to try to get it working. I'll be back after the Thursday NPR deadline to share my results. Good luck!

Update

The Thursday deadline has passed, so here's my solution: 


See you next week!

Director, anagram, film award

Welcome back to Natural Language Puzzling, the blog where we use natural language processing and linguistics to solve the Sunday Puzzle from...