Friday, July 30, 2021

Olympic Sports (Solution)

Hi Friends! Let's look at the latest Sunday Puzzle from NPR:

This week's challenge: It comes from the puzzlemaker and editor Peter Gordon. Think of the word for a competitor in a particular Olympic sport. It's a compound word with a hyphen in the middle. Remove the hyphen. What remains are two words from a different Olympic sport. What words are these?

I've cracked this one, and I'll share the solution at the end of this post.

On a personal note: Yours truly is on the verge of becoming Dr. NaturalLanguagePuzzler. Things have been especially busy the last few weeks preparing for my PhD defense, but I plan to post a more detailed breakdown of this puzzle ASAP. I didn't write a complete solver script for this one, but I did use SBERT in masking mode and Word2Vec to generate some candidate words and the solution kind of popped out from there. If I get a chance between frantically editing slides, I'll put together a formal script and walk you through it as usual! :-)

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

shot-putter ---> shot, putter


I know, I know---I too think "shot" is super generic and a bit of a stretch for this puzzle, but this is the best I could come up with and I think it's what Puzzlemaster Will Shortz is asking for here.


Catch you on the next Sunday Puzzle!

--Levi King

Saturday, July 24, 2021

A Flower and a Girl's Name (Solution)

 I'll try to write up my approach soon, but in the meantime:


amaryllis --> Mary, Allis (Alice)

Thursday, July 15, 2021

Country, Company, Competitor (Solution)

Hiya Puzzlers! After a total fail last week, I'm back with a solution for this week's puzzle. That's your spoiler alert---solution is at the end of this post.

I didn't post a preview this week, so I'll do a full breakdown here. Let's see this week's Sunday Puzzle:

This week's challenge comes from listener Peter Collins, of Ann Arbor, Mich. Think of a country. Embedded in consecutive letters is a well-known brand name. The first, second, eighth and ninth letters of the country, in order, spell a former competitor of that brand. Name the country and the brands.

This is quite similar to the puzzle we solved two weeks ago. In that puzzle, there was a Japanese food embedded in the name of a US city, and then the remaining letters could be used to spell a Mexican food. The first part is very similar, but we don't have the unscrambling spelling part this time. So I started my solver script for the current puzzle by recycling the city/foods puzzle solver script.

To solve this puzzle we need:

  • C: a list of countries;
    • This is easy enough to find online, but we've already got this list on hand from previous puzzles; I'm lazily pasting it into my python solver script, i.e., hard coding it;
    • Pro-tip: you'll want to be flexible with what you accept in your list and include variant names; e.g., "Côte d'Ivoire" and "Ivory Coast" and "Republic of Côte d'Ivoire";
    • We'll also want to ASCII-fy this list: e.g., "Côte d'Ivoire" --> "Cote d'Ivoire";
      • I do this in the solver script with slugify, which also lowercases letters;
    • And we'll want to remove any non-letters: "cote d'ivoire" --> "cotedivoire";
    • And we know we need at least 9 letters, so we'll go ahead and filter any shorter strings out of our list;
  • B: a list of brands;
    • I cobbled one together from various lists on the web; I also hard coded directly this into my solver script;
    • We'll want to handle these similarly to the country names: ASCII-fy, remove whitespace and non-letters, and lowercase everything;
From here, there's not a lot of processing to do. Basically, we check each country in C to see if any brand in B appears as a substring, and when we find a match, we get the first, second, eighth and ninth letters of the country, concatenate them in order to get the competitor (all as specified above in the puzzle), and then check to see if the competitor string appears in the list of brands. It's like this:

  • for country in C:
    • for brand in B:
      • if brand in country:
        • competitor = country[0]+country[1]+country[7]+country[8]
          • if competitor in B:
            • print("Solution: "country+" & "+brand+" & "+competitor)

And that's how I solved it! See my script and if you want to see more. I'm posting the solution below.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Saudi Arabia, Audi, Saab

Saturday, July 10, 2021

Plants and Spoonerisms (Solution)

 TBD...

US City, Japanese Food (Solution)

Welcome back. It's time for a solution to the most recent Sunday Puzzle from NPR:

This week's challenge comes from listener Julia Lewis, of Fort Collins, Colo. Take the name of a major American city. Hidden inside it in consecutive letters is the name of a Japanese food. Remove that. The remaining letters can be rearranged to to spell some Mexican foods. Name the city and the foods.

I don't have much to add to the approach I discussed in my preview post, so I'll just link you back to that post, and to my solver script, annotated with comments and posted to the GitHub repo for this blog.

Oh yeah, I have the solution, too, if you just want to see that. Spoiler alert! Scroll down for my solution.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Solution:

Sacramento, ramen, tacos


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...