Wednesday, March 27, 2024

Pangrams Anyone?

Regular readers of this blog know that I have been doing the New York Times Spelling bee (Computer Science Teacher: Spelling Bee Solver Project). Actually, I do it with my wife who gets most of the words. Anyway, one of the special types of words in the puzzle is called a pangram. Now officially, a pangram is a sentence that includes all of the letters in the alphabet. Anyone who has taken a typing class is probably familiar with this famous pangram.

The quick brown fox jumps over the lazy dog

In the Spelling bee, a pangram is a single word that includes all of the letters in the puzzle for that day. This all suggested a couple of possible programming assignments.

The most obvious (to me) is a program that determines if a sentence is a pangram. The program would have to ignore things like spaces, punctuation, and other special characters.  A step up would be to determine if a sentence is a perfect pangram. A perfect pangram uses each letter only once. Also called a Heterogram

Another idea, which I actually coded myself, is to determine if a word is a pangram of a certain number of letters.That is to say, find words  that have a specific number of unique letters. I haven’t tried to find perfect word pangrams but I might do that next.

I had a program search a large data set of words looking for pangrams. Mostly I looked for seven letter ones as that is what the NY Times Spelling bee uses.There are a lot of them!

One could also determine if all the letters are in alphabetical order. There is probably a name for that as well. Anyone know?

No comments: