A pangram is a sentence that contains every letter of the alphabet at least once. For some the challenge has always been to come up with pangrams that are as short as possible. Short pangrams in English are quite difficult to come up with and tend to use uncommon words, because the English language uses some letters (especially vowels) much more frequently than others. The archetypal "artificial" sentence of 35 letters that is often used as an example of an English pangram is
The quick brown fox jumps over the lazy dog.
Others believe that these constructed pangrams are too contrived, and search published works for pangrammatic windows1. These are stretches of naturally occurring text that contain all letters in the alphabet at least once. For a long time, the shortest known window in a published work was found in Lillie de Hegermann-Lindencrone's 1912 book In the Courts of Memory2, which contains the following excerpt.
I sang, and thought I sang very well; but he just looked up into my face with a very quizzical expression, and said, 'How long have you been singing, Mademoiselle?'
The stretch of text that has been marked in yellow is a pangrammatic window containing 56 letters. This is already quite short, but can we do better? In 2012 a 42-letter example was discovered in Piers Anthony's 2003 novel Cube Route3.
"We are all from Xanth," Cube said quickly. "Just visiting Phaze. We just want to find the dragon."
In 2014, Jesse Sheidlower wrote a bot called PangramTweets4 that listens to Twitter messages and automatically retweets5 them if they are pangrams. Inspired by this, Google software engineer Malcolm Rowe set out to search first Project Gutenberg6 and then the entire Internet7 for the shortest possible window. Remarkably he found one of only 36 letters in a review of the film Magnolia8 by Todd Ramlow for PopMatters.
Further, fractal geometries are replicated on a human level in the production of certain 'types' of subjectivity: for example, aging kid quiz show whiz Donnie Smith (William H. Macy) and up and coming kid quiz show whiz Stanley Spector (Jeremy Blackman) are connected (or, perhaps, being cloned) in ways they couldn't possibly imagine.
On his blog, Row wrote:
I'm pretty impressed by this result. It's only one letter longer than "The quick brown fox …", and while that's not the shortest possible pangram by far, it is one of the more coherent ones.
Write a function pangram that takes a string as its argument. The function must return a Boolean value that indicates whether the given string is a pangram.
Write a function window that takes a string as its argument. The function must return the text of the shortest pangrammatic window that can be found in the given string. The length of a pangrammatic window is measured as the length of the substring, not as the number of letters in that substring. In case the given string should contain multiple shortest pangrammatic windows, the text of the leftmost occurrence of a shortest pangrammatic window must be returned. The value None must be returned in case the given string does not contain any pangrammatic windows.
>>> pangram('The quick brown fox jumps over the lazy dog.')
True
>>> pangram('The quick brown fox jumped over the lazy dog.')
False
>>> window('The quick brown fox jumps over the lazy dog.')
'quick brown fox jumps over the lazy dog'
>>> window('The quick brown fox jumped over the lazy dog.')
>>> window("I sang, and thought I sang very well; but he just looked up into my face with a very quizzical expression, and said, 'How long have you been singing, Mademoiselle?' ")
'g very well; but he just looked up into my face with a very quizzical ex'
>>> window("'We are all from Xanth,' Cube said quickly. 'Just visiting Phaze. We just want to find the dragon.'")
"from Xanth,' Cube said quickly. 'Just visiting Phaze. W"
>>> window("Further, fractal geometries are replicated on a human level in the production of certain 'types' of subjectivity: for example, aging kid quiz show whiz Donnie Smith (William H. Macy) and up and coming kid quiz show whiz Stanley Spector (Jeremy Blackman) are connected (or, perhaps, being cloned) in ways they couldn't possibly imagine.")
'bjectivity: for example, aging kid quiz show'
Chaikin (2006). Joaquin Through the Pangram Window. Word Ways 39(2), 17-37. 9
Irvine SA (2012). A 42-letter Pangrammatic Window. Word Ways 45, 313–316. 10
Keith M (2002). New Record Pangrammatic Windows. Word Ways 35(4), article 2. 11
Keith M (2006). Sub-60-Letter Pangrammatic Windows. Word Ways 39(1), article 2. 12
Pearson AC (1907). The Twentieth Century Standard Puzzle Book. London: George Routledge & Sons, LTD., New York: E.P. Dutton & co.