07 August 2010


Yesterday I wrote about Frink, a sophisticated programmable calculator that is wonderfully adept at dealing with units of measurement.

One of my readers asked in the comments to yesterday's post whether Frink is aware of the "Klafter" (an erudite, geeky, and witty lot, my readers).

The Klafter is a now-antiquated unit of length formerly used in many German-speaking lands.  It was said to be the distance between the tips of the middle fingers of a man with outstretched arms.  Like many units of measurement based on variable body parts, the length of the Klafter differed from place to place.

The Austrian Klafter (the only one that mattered much to me) was equivalent to 1.8965 meters.  I wrote about the Klafter many years ago in a review article published in the Haydn Yearbook on Mary Sue Morrow's Concert Life in Haydn's Vienna; the Klafter was used in old floor plans of the Viennese court theaters (the old Burgtheater and the Kärntnertortheater), and accurate conversions to modern units were necessary there for understanding the sizes of the theaters.  You can see snippets here (unfortunately only snippets) of what I had to say about Klafter.  (If I had a scanner, I would make the review available on the web.)
[UPDATE: My review-article on Morrow's book can now be downloaded or read online here.  Many thanks to the person who sent this pdf to me.]

The German Wikipedia article on Klafter brings to light that the Klafter is still in use in Liechtenstein as the basis for a unit of area, the Quadratklafter = 3.59665 m2 (based on the old Austrian Klafter of 1.8965 m).

As it turns out, the Klafter is one of the few units of measurement that Frink doesn't know about. 

A complete list of the many hundreds of units it does know about can be seen here.  These include, among many many others:
  • the lengths of days and years for all the planets in the Solar System
  • musical intervals (and the Pythagorean and syntonic commas)
  • French champagne bottle sizes
  • USA slang units (buck, fin, sawbuck, etc.)
  • British Imperial weights and measures
  • "Obscure British volume measures" (such as the bag, bucket, noggin, pottle, and puncheon)
  • paper measures and sizes (only modern ones, but hey, you can't have everything)
  • Scots and Irish linear measures
  • Ancient History units (such as the 16 kinds of cubits I pointed to yesterday)
And many more.

Thus one can easily discover, for example that 1 jereboam is equivalent to (rounded) 608.65 teaspoons.

This afternoon I was talking to a friend of Latvian heritage, who got quite excited about the possibility of easily converting the measurements in grams in her Latvian cookbooks to cups, tablespoons, and teaspoons.  This is very easy to do in Frink:
250 g / sugar -> cup
In other words, 250 grams of sugar is equal to 1¼ cups.

It is extremely easy to add units to Frink.  For example, to add the Klafter, I simply write:
klafter := 1.8965 m
And now I can easily convert Klafter to meters:
9.75 klafter -> m
gives the result 18.490875 meters.

Easy enough to do with a regular calculator, of course.  But now that Frink "knows" about Klafter, I can quickly calculate:
klafter -> egyptianroyalcubit
A conversion that may never previously have been done in the whole of human history.

Frink is also equipped with a very wide array of functions.  A couple that caught my eye:
factor[x] returns the prime factors of an integer x (I did a lot of factoring in my dissertation)

isPrime[x] returns false if the integer is composite, true if it is prime or probably prime  (yes, this will work with very large numbers).

char["Frink"] returns an array of the Unicode character codes for each symbol in the string.
The latter appears to work correctly on more "exotic" characters.  For example, char["ž"] returns 382. In order to make sure this was correct, I had to convert it to hexadecimal, which is very simple to do in Frink: the command is  char["ž"] -> hexadecimal, which returned 17e....which is, in fact, the Unicode character code for a lowercase z with a haček (or a Latin Small Letter Z with Caron, as Unicode describes it).

I was amused to learn that Frink even has a translation function. Regular readers will remember that a couple of weeks ago I wrote a post inspired by a game suggested by games with words, based on the iterative use of Google Translate (English to Japanese to English to Japanese ...) to look for interesting "non-converging" translations.  My post on this blog tracked the fate of the first sentence of Jane Austen's Pride and Prejudice through this kind of iterative translation in several languages.

The documentation for Frink uses a classic sentence that (so far as I can recall) was never tried in the thread at games with words:
"My hovercraft is full of eels." -> German
Which returns:
Mein Luftkissenfahrzeug ist von den Aalen voll.
(For the non-geeks in my audience, this phrase is from a classic Monty Python sketch:


So naturally, I decided to test Frink on the iterative translation game.  I began with one of the most "successful phrases" in the games without words thread, translated to Japanese and back:
Japanese["Colorless green ideas sleep furiously"]

This shows an alternative syntax for the translation function.  The complete first iteration:
Japanese["Colorless green ideas sleep furiously"] -> JapaneseToEnglish

As for thought of colorless green you sleep fiercely
It would be easy to write a short program in Frink to extend the number of iterations (one could probably even write it recursively).  But it's time for dinner, so I leave this as an exercise for the reader.

And, for my Dad (who first told me the classic meme about machine translation using this sentence):
Russian["The spirit is willing but the flesh is weak."] -> RussianToEnglish

Spirit is willingly ready but flesh it is weak.
And finally, Jane Austen, to Russian and back:
Russian["It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife. "] -> RussianToEnglish

The universally confirmed truth, then single person in the possession success, must be inside wants husbands.
And the same in Japanese:
Japanese["It is a truth universally acknowledged, that a single man in possession of a good fortune, must be in want of a wife. "] -> JapaneseToEnglish

That is recognized the wife being necessary, generally, the single person who owns that good fortune, there is a truth, it becomes, is.
Although your interpretation of that sentence may depend on what you think the meaning of "is" is.

Personally, I think Frink is the greatest thing since the invention of the roof.

Bookmark and Share


  1. Legend saith that the phrase "The spirit is willing but the flesh is weak" was translated by a computer program as "The liquor is passable but the meat has gone bad."

  2. what about Scheffel, which is at the same time a cubic and square measure

  3. I meant to suggest in my post that if we could come up with a relatively comprehensive and reliable source for old German units of measurement, preferably a source that is readily available (on, say, Google Books), I would send that reference on to Frink's developer Alan Eliasen. Given a good reference, I think he might eventually include these.

    Suggestions for such a reference?

  4. http://de.wikipedia.org/wiki/Alte_Ma%C3%9Fe_und_Gewichte#Raumma.C3.9Fe

  5. (1836) : http://books.google.at/books?id=3p87AAAAcAAJ&pg=PA117&dq=tafel+ma%C3%9Fe+und+gewichte&hl=de&ei=YK9eTLubK87uOYnbmb4J&sa=X&oi=book_result&ct=result&resnum=1&ved=0CCwQ6AEwADgU#v=onepage&q=tafel%20ma%C3%9Fe%20und%20gewichte&f=false

    for zurich only (1837): http://books.google.at/books?id=gTtCAAAAcAAJ&pg=PA7&dq=tafel+ma%C3%9Fe+gewichte&hl=de&ei=V6teTP_fNeOHOJynvL0J&sa=X&oi=book_result&ct=result&resnum=1&ved=0CDIQ6AEwAA#v=onepage&q=tafel%20ma%C3%9Fe%20gewichte&f=false

  6. The sources from 1836 and 1837 look good...but I'm guessing that the developer of Frink can't read Fraktur (at least we shouldn't assume). To be honest, I hadn't anticipated that problem.

    The Wikipedia article looks very good, and gives the impression of being based on sound sources. I think I've run into one of these before: