SMS language is a term for the abbreviations and slang commonly used with mobile phone text messaging. Early mobile phone messaging encouraged users to use abbreviations because i) text entry was difficult, requiring multiple key presses on a small keypad to generate each letter, ii) messages were limited to a maximal number of characters, and iii) operators were charging a cost per letter.

SMS language

Once SMS language became popular, it took on a life of its own and was often used outside of its original context. At its peak, it was the cause of vigorous debate about its potentially detrimental effect on literacy, but with the advent of alphabetic keyboards on smartphones its use — and the controversies surrounding it — have receded.

Assignment

Some people compress text messages by replacing doubled letters with single letters and by retaining only those vowels that begin a word. Note that the order in which these two operations are executed is important: first removal of duplicates and then removal of vowels. Your task is to implement these operations, such that they can be used to abbreviate text messages. To do so, you have to implement the following four functions that each take a single string argument:

Example

>>> removeDuplicates('bookkeeper')
'bokeper'
>>> removeDuplicates('Aardvark')
'Ardvark'
>>> removeDuplicates('eELGRASS')
'eLGRAS'

>>> removeVowels('bookkeeper')
'bkkpr'
>>> removeVowels('Aardvark')
'Ardvrk'
>>> removeVowels('eELGRASS')
'eLGRSS'

>>> txtWord('Some')
'Sm'
>>> txtWord('people')
'ppl'
>>> txtWord('compress')
'cmprs'
>>> txtWord('text')
'txt'
>>> txtWord('messages')
'msgs'

>>> txtSentence('And now for something completely different!')
'And nw fr smthng cmpltly dfrnt!'
>>> txtSentence('Some people compress text messages by replacing doubled letters with single letters and by retaining only those vowels that begin a word.')
'Sm ppl cmprs txt msgs by rplcng dbld ltrs wth sngl ltrs and by rtnng only ths vwls tht bgn a wrd.'