Christmas haiku - in Swedish

Here are five automatically generated "haiku" verses in Swedish. They are based on several popular Swedish christmas tunes. Refresh the page to get a new set!

Det snöre slänger
Gnistrande kristallets vrå
Tio för att tittar

Stallyktan flyter
Se, där höga furor står
Att julgran och bror

Pappa, mamma kyss
När ljudet honom tryter
Och julen är små

Barnen i ringer
De sakta ner till påska
Snälla husbond stek

Hej, mitt vintersång
I mitt vi från grenen där
Och det juleljus

The algorithm is pretty interesting. It is based on an old idea from Scientific American (vol 249, no 5, Nov 1983, pages 18-28: "Computer Recreations - A progress report on the fine art of turning literature into drivel" by Brian Hayes) and uses frequency data from a given text to calculate probability weights to be used in random character selection. This means that new "words" could possibly be generated from existing word parts, and new sentences will usually be produced, often by combining parts from many different sentences in the source text. By combining source texts in wildly different styles, one can get surprising results.
The frequency table doesn't simply contain simple character frequencies but rather the probability for a given character to appear as continuation of an existing sequence of characters. The sequence length is a parameter to the program and it affects the result significantly, with the gibberish level increasing for smaller values.

Worth noting is also that it's not anywhere near as easy to auto-generate haiku in English. Syllables are easy to identify in Swedish, with near 100% correctness. In English, automatically identifying syllables is a far more daunting task.