Spoonerise words... in Finnish This challenge is based on, and contains test cases from, a programming course I took at Aalto University. The material is used with permission.
Two and a half years ago there was a challenge about spoonerisms in English. However, in Finnish spoonerisms are much more complicated.
Spoonerisms in Finnish
In Finnish, the vowels are aeiouyäö and the consonants are bcdfghjklmnpqrstvwxz. (å is technically part of Finnish, but is not considered here.)
The most basic spoonerisms only take the first vowel of each word, and any consonants preceding them, and exchange the parts:
henri kontinen -> konri hentinen
tarja halonen -> harja talonen
frakki kontti -> kokki frantti
ovi kello -> kevi ollo
Long vowels
Some words contain two of the same consecutive vowel. In those cases, the vowel pair must be swapped with the other word's first vowel, shortening or lengthening vowels to keep the length same.
haamu kontti -> koomu hantti
kisko kaappi -> kasko kiippi
In the case of two different consecutive vowels this does not apply:
hauva kontti -> kouva hantti
puoskari kontti -> kooskari puntti
Three or more of the same consecutive letter will not appear in the input.
Vowel harmony
Finnish has this lovely thing called vowel harmony. Basically, it means that the back vowels aou and front vowels äöy should not appear in the same word.
When swapping front or back vowels into a word, all vowels of the other kind in the rest of the word should be changed to match the new beginning of the word (a &lt;-&gt; ä, o &lt;-&gt; ö, u &lt;-&gt; y):
köyhä kontti -> kouha köntti
hauva läähättää -> läyvä haahattaa
e and i are neutral and may appear with all other letters; swapping them into a word must not cause changes to the rest of the word.
Special cases
Vowel harmony does not apply to some words, including many loan words and compound words. These cases are not required to be handled &quot;correctly&quot;.
Challenge
Given two words, output the words spoonerised.
The input words will only contain the characters a-z and äö. You may choose to use uppercase or lowercase, but your choice must be consistent between both words and input/output.
I/O may be done in any convenient format. (Words should be considered strings or arrays of characters.)
This is code-golf, so the shortest solution in bytes wins.
Test cases


henri kontinen -&gt; konri hentinen
tarja halonen -&gt; harja talonen
frakki kontti -&gt; kokki frantti
ovi kello -&gt; kevi ollo
haamu kontti -&gt; koomu hantti
hauva kontti -&gt; kouva hantti
puoskari kontti -&gt; kooskari puntti
köyhä kontti -&gt; kouha köntti
hauva läähättää -&gt; läyvä haahattaa
frakki stressi -&gt; strekki frassi
äyskäri kontti -&gt; kouskari äntti
hattu sfääri -&gt; sfätty haari
ovi silmä -&gt; sivi olma
haamu prätkä -&gt; präämy hatka
puoskari sfääri -&gt; sfäöskäri puuri
puoskari äyskäri -&gt; äöskäri puuskari
uimapuku hajoa -&gt; haimapuku ujoa
ihme baletti -&gt; bahme iletti
uhka lima -&gt; lihka uma
osuma makkara -&gt; masuma okkara
makkara fakta -&gt; fakkara makta
lapsi laiva -&gt; lapsi laiva
firma hajoa -&gt; harma fijoa
dimensio bitti -&gt; bimensio ditti
flamingo joustava -&gt; jomingo flaustava
globaali latomo -&gt; labaali glotomo
trilogia fakta -&gt; falogia trikta
printti maksa -&gt; mantti priksa
riisi bitti -&gt; biisi ritti
sini riisi -&gt; rini siisi
aarre nyrkki -&gt; nyyrre arkki
laavu laki -&gt; laavu laki
kliininen parveke -&gt; paaninen klirveke
priimus kahvi -&gt; kaamus prihvi
spriinen lasta -&gt; laanen sprista
kliimaksi mammona -&gt; maamaksi klimmona
hylky hupsu -&gt; hulku hypsy
kehys fiksu -&gt; fihys keksu
levy huhu -&gt; huvu lehu
tiheys guru -&gt; guheus tiru
nyrkki heiluri -&gt; herkki nyilyri
latomo hajoa -&gt; hatomo lajoa
prisma lehti -&gt; lesma prihti
viina baletti -&gt; baana viletti
JavaScript (ES6), 196 175 bytes
Takes the words as two strings in currying syntax (a)(b). Returns an array of two arrays of characters.
a=&gt;b=&gt;[(e=/(.*?)([eiäaöoyu])(\2?)(.*)/,g=(a,[,c,v])=&gt;[...c+v+(a[3]&amp;&amp;v)+a[4]].map(c=&gt;(j=e.search(v),i=e.search(c))&gt;9&amp;j&gt;9?e[i&amp;~1|j&amp;1]:c))(a=e.exec(a),b=e.exec(b),e+=e),g(b,a)]

Try it online!
How?
Each input word is passed through the regular expression e, which has 4 capturing groups:
e = /(.*?)([eiäaöoyu])(\2?)(.*)/    1: leading consonants (or empty)
     [ 1 ][     2    ][ 3 ][ 4]     2: first vowel
                                    3: doubled first vowel (or empty)
                                    4: all remaining characters

The helper function g() takes all capturing groups of the word to be updated as a[ ] and the first and second capturing groups of the other word as c and v.
We apply basic spoonerism and take care of long vowels with:
c + v + (a[3] &amp;&amp; v) + a[4]

To apply vowel harmony, we first coerce the regular expression e to a string by adding it to itself, which gives:
e = &quot;/(.*?)([eiäaöoyu])(\2?)(.*)//(.*?)([eiäaöoyu])(\2?)(.*)/&quot;
     ^^^^^^^^^^^^^^^^
     0123456789ABCDEF (position as hexa)

Vowels that need to be harmonized have a position greater than 9 in the resulting string. Furthermore, the expression was arranged in such a way that front vowels äöy are located at even positions, while back vowels aou are located at odd positions, next to their counterparts.
Hence the following translation formula which is applied to each character c of the output word:
(j = e.search(v), i = e.search(c)) &gt; 9 &amp; j &gt; 9 ? e[i &amp; ~1 | j &amp; 1] : c