Syllabify English words - kind of You're tasked with writing a program that syllabifies words in a string of text, by separating them with a hyphen. That would be a lot of work, so you want to skip some parts, mainly because you don't want to have a table of the pronunciations required for perfect algorithm. You also want to make it as short (and thus unreadable and unmaintainable) as possible as a revenge for being given this assignment.
You have two choices:

Write a program that takes the string from STDIN and outputs the result to STDOUT.
Write a function that takes the string as a single parameter, and returns the result.

Specification

In this case, string means any string-like construct in your language of choice (byte arrays, character arrays, strings...).
Vowels are a, e, i, o, u
The string given has 1 &lt;= n &lt;= 10 words, where each has a length between 1 - 30 characters, inclusive.. Your output should be those words hyphenated.
All letters are lowercase and words are always separated with spaces. Thus, the input consists of characters [a-z ]
Apply rules in order of importance.
When a word is divided, start again with the right half of the word.

Rules for syllabification, in order of importance
Two consecutive same vowels count as one (ie. feet has only one vowel, but beat and finding have two). Every syllable has exactly one vowel, thus there is one syllable for each vowel.

If the whole word has only four letters, return it unchanged. (skip this for the rest of the word)
If the word has only one vowel, return the word unchanged.
If the word has two consecutive vowels, divide between them (ie. diaspora -&gt; di-as-po-ra)
When two or more consonants come between two vowels (same or different), divide after the first consonant (ie. sis-ter) unless the consonant part is ck, in which case divide the word after it. (ie. nickel -&gt; nick-el)
When a y comes between two vowels, divide the word after it (e.g. paying -&gt; pay-ing).
When one consonant comes between two vowels (same or different), divide before the consonant (ie. dra-gon)
Return the word unchanged if no division could be done.

I chose these rules, because they can be applied recursively without problems and require no pronunciation tables. Thus, they are not accurate, and for example rule #5 is often not correct. In general case though, it is.
Example
In:  hello world
Out: hel-lo world

In:  have a nice day
Out: have a nice day

In:  pour some nickel and xenon there
Out: pour some nick-el and xe-non the-re
Lua, 292

Lua might not have been the best language to do this in, but it works. It pretty much flows like the question asked. The rules are mainly in order with some optimizations: #2 is skipped (it isn't needed unless there is a one vowel word with "ck" at the beginning), and the ck and y rules are gone through before the rest of #4 and #6, which are combined. Since some vowels in the word need to be captured twice (after one hyphen and before another), that search is performed twice.

i=io.read()v="([aeiou])"for s in i:gfind("%l+ ?")do
if s:len()~=4 then
s=s:gsub(v..v,function(x,y)if x==y then return x..y;end;return x.."-"..y;end)s=s:gsub("ck"..v,"ck-%1")s=s:gsub(v.."y"..v,"%1y-%2")for b=1,2 do
s=s:gsub(v.."([^aeiou\-]?)([^aeiou\-]+)"..v,"%1%2-%3%4")end
end
io.write(s)end


Ungolfed

function checkEquals(x,y)
    if x==y then 
        return x..y
    end
    return x.."-"..y
end
i=io.read()
v="([aeiou])"
for s in i:gfind("%l+ ?") do
    if s:len()~=4 then
        s=s:gsub(v..v,checkEquals)
        s=s:gsub("ck"..v,"ck-%1")
        s=s:gsub(v.."y"..v,"%1y-%2")
        for b=1,2 do
            s=s:gsub(v.."([^aeiou\-]?)([^aeiou\-]+)"..v,"%1%2-%3%4")
        end
    end
    io.write(s)
end


Test it here: http://ideone.com/g57TzA