Thanks to ovs for helping me reduce this
f x=1:[0|7*x==x*x] g q|r<-q>>=f=length r==17&&r!!5*r!!12>0
The first thing we do is convert the input to a sort of syllable map. That is a list of integers, one for each syllables with the following meaning:
- First syllable of a word
- Second syllable of a word
So with this we check that the length of is 17, that is there are 17 syllables all in all. Then we index the syllable codes at the beginning of the second and third lines. We multiply these together. If either of them is the second syllable of a word this product is zero because zero times any number is zero. And if both of them are 1 then it is not zero. So we check that this is not zero.
And that's it.