The idea to write a sentence — or a longer piece of poetry or prose — of which the lengths of the consecutive words match the digits of the number $$\pi$$ (=3.14159265358979…), was brought forward in the 20th century. One of the earliest and most famous examples is the following sentence, which was presumably written by the English physicist Sir James Jeans:
How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics!
The first word consists of three letters, the next word of one letter, the next word of four letters and so on, and together they form the first fifteen digits of the number $$\pi$$. The following Pilish poem (written by Joseph Shipley) matches the first 31 digits of π:
But a time I spent
wandering in bloomy night;
Yon tower, tinkling chimewise, loftily opportune.
Out, up, and together came sudden to Sunday rite,
The one solemnly off to correct plenilune.
It is no coincidence that the poem (not unlike every other mnemonic for
$$\pi$$ dating from before 1990) ends somewhere around the 33th
digit of $$\pi$$: this digit of $$\pi$$ equals zero.
How, after all, could zeroes be presented in this schedule? Some authors
have used punctuation or text format to represent zeroes - for example, by
using the end of a sentence or certain punctuation marks such as commas or
semicolons to represent zeroes. However, these schemes are quite
artificial, and not as convenient (as a mnemonic) as schemes that only
rely on the number of letters of a word. We do not know who, but someone
finally thought to use ten-letter words to represent zeroes, what seems
like a pretty good solution. With this method it is not only useful to
represent a single zero, but also series of zeroes (like 00 or 000). This
scheme is called Basic Pilish,
the term Pilish refers to "English that follows the successive
digits of pi". Briefly put, in Basic Pilish every word of $$n$$
letters
represents the digit $$n$$ if $$n < 10$$
represents the digit $$0$$ if $$n = 10$$
This rule works very well for hundreds of digits, and makes it possible to formulate long texts that represent the number $$\pi$$ without being too obvious for the the reader at first. But eventually a problem emerges that can be solved by using Standard Pilish. In Basic Pilish the problem starts when long strings of small non-zero numbers (such as 1121 or 1111211) should be presented in a natural manner, because long strings of one-letter words are unusual in most languages. A second problem with Basic Pilish is that there are no words admitted that consist of more than ten letters, which is a problem if one wants to write about common themes such as objectiveness or cheeseburgers.
In Standard Pilish, the previous two problems do not occur. In this scheme every word with $$n$$ letters
represents the digit $$n$$ if $$n < 10$$
represents the digit $$0$$ if $$n = 10$$
represents the consecutive digits of $$n$$ if $$n > 10$$
(a twelf-letter word, for example, represents the digits 1 and 2)
Here the third rule is actually not the exception, but the second rule 2 is if we describe the algorithm in the following way: to determine the digits of the number $$\pi$$ on the basis of a text written in Standard Pilish, you write the number of letters of the word next to each word (except ten-letter words where a zero is written next to it). Then you read all the digits in sequence from beginning to end so as to obtain the value of $$\pi$$. Note that this definition works for texts in both Basic and Standard Pilish.
To be absolutely clear, we still have to determine how punctuation marks are interpreted in a text in Pilish - or more generally, how each symbol should be treated that is not a letter (A-Z or a-z). The rules we will apply are the following:
If one or more words contain quotation marks, they are simply ignored. The text fragment couldn't therefore will be treated as if it says couldn't, providing a seven-letter word.
Any character that is not a letter or quotation mark shall be treated as a separation mark. That's the same as saying that such characters are treated the same as white space.
Input consists of several lines, closed with a line containing only three points. No other line contains only three points.
For each line in the input (except for the last line containing only three points) write the conversion of the text on the line to a series of digits on a separate line, if the text is interpreted as Pilish.
Input:
But a time I spent wandering in bloomy night;
Yon tower, tinkling chimewise, loftily opportune.
Out, up, and together came sudden to Sunday rite,
The one solemnly off to correct plenilune.
...
Output:
314159265
358979
323846264
3383279