You're creating a conlang called Eadibitan. But you're too lazy to come up with your own phonology, grammar and orthography. So you've decided to automatize the proccess.
Write a function that translates an English word into Eadibitan.
English syllables should be analysed according to the following rules:
y should be analyzed as a consonant if followed by a vowel, and as a vowel otherwise.The order of the letters of each syllable should be altered according to the following table:
| English | Eadibitan |
|---|---|
| c1 v1 | v1 c1 |
| c1 v1 v2 | v1 c1 v2 |
| c1 v1 v2 v3 | v1 c1 v2 v3 |
| c1 v1 c2 | v1 c1 c2 |
| c1 v1 v2 c2 | v1 c1 v2 c2 |
| c1 v1 v2 v3 c2 | v1 c1 v2 v3 c2 |
| c1 c2 v1 | c2 v1 c1 |
| c1 c2 v1 v2 | c2 v1 c1 v2 |
| c1 c2 v1 v2 v3 | c2 v1 c1 v2 v3 |
| c1 c2 v1 c3 | c2 v1 c1 c3 |
| c1 c2 v1 v2 c3 | c2 v1 c1 v2 c3 |
| c1 c2 v1 v2 v3 c3 | c2 v1 c1 v2 v3 c3 |
Any other pattern should be left untouched.
eadibitan("innokodakademijaian") ➞ "eadibitan"
eadibitan("star") ➞ "tasr"
eadibitan("beautiful") ➞ "ebauitufl"
eadibitan("statistically") ➞ "tasitsitaclyl"