When chemists at the University of California, Berkeley1 discovered elements 97 and 98, they named them berkelium2 and californium3. The New Yorker4 suggested:
With this the school showed a surprising lack of public-relations foresight: now it has lost forever the chance of immortalizing itself in the atomic tables with some such sequence as universitium (97), ofium (98), californium (99) and berkelium (100).
The discoverers sent back a reply:
By using these names first, we have forestalled the appalling possibility that after naming elements 97 and 98 universitium and ofium, some New Yorker might follow with the discovery of elements 99 and 100 and apply the names newium and yorkium.
The magazine answered:
We are already at work in our office laboratories on newium and yorkium. So far we just have the names.
Existing words can be chemified by
removing all vowels at the end of the word
appending the suffix -ium at the end of the word, except if the word already ends with -ium
In doing so, we consider the letters a, e, i, o, u and y to be vowels. Your task:
Write a function chemifyWord that takes a word (str) that only contains letters (both lowercase and uppercase letters are allowed). The function must return the chemified version of the given word.
Write a function chemify that takes a sentence (str). The function must return the chemified version of the given sentence, which is constructed by replacing each word in the sentence by its chemified version. The words of the sentence are formed by the longest possible sequence of letters.
>>> chemifyWord('California')
'Californium'
>>> chemifyWord('BERKELEY')
'BERKELium'
>>> chemifyWord('of')
'ofium'
>>> chemifyWord('Belgium')
'Belgium'
>>> chemify('University of California, Berkeley')
'Universitium ofium Californium, Berkelium'
>>> chemify('Ghent University, Belgium')
'Ghentium Universitium, Belgium'