[Tutor] Re: Capitalization what does it do exactly

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Wed Nov 6 19:53:02 2002


> >>HTH
> >
> >Well, there's another capitalized "word". In this case it's an acronym,
> >which, IMHO, means Hope This Helps. Now what the heck is IMHO?
>
> In My Honest Opinion this mail is off topic!

... although it would be very easy to bring this back on track.  *grin*



Has anyone written a program to generate acronyms from a sentence?

###
>>> def acronym(sentence):
...     return join([word[0] for word in sentence])
...
>>> def join(words):
...     return "".join(words)
...
>>> acronym(["International", "Business", "Machines"])
'IBM'
>>> acronym(['I', 'Am', 'Not', 'A', 'Lawyer'])
'IANAL'
###

This is a really simple function, perhaps too simple.  (It's adapted from
an example in the excellent book "Simply Scheme").

Are there any improvements we can make to something like this to make it
better or cleaner?