fork(6) download
  1. i=io.read()v="([aeiou])"for s in i:gfind("%l+ ?")do
  2. if s:len()~=4 then
  3. s=s:gsub(v..v,function(x,y,z)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
  4. s=s:gsub(v.."([^aeiou\-]?)([^aeiou\-]+)"..v,"%1%2-%3%4")end
  5. end
  6. io.write(s)end
Success #stdin #stdout 0.01s 2500KB
stdin
gordon fears freaky salad with the passion of hundreds of nickles
stdout
gor-don fe-ars fre-aky sa-lad with the pas-si-on of hun-dreds of nic-kles