<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hello,<BR>
<BR>
For a exerise I made this one :"<BR>
<BR>
import string<BR>
def extract_words(s):<BR> """<BR> >>> extract_words('Now is the time! "Now", is the time? Yes, now.')<BR> ['now', 'is', 'the', 'time', 'now', 'is', 'the', 'time', 'yes', 'now']<BR> >>> extract_words('she tried to curtsey as she spoke--fancy')<BR> ['she', 'tried', 'to', 'curtsey', 'as', 'she', 'spoke', 'fancy']<BR> """<BR> word= ""<BR> s=string.lower(s)<BR> for char in s :<BR> if ord(char) >=65 and ord(char) <= 122 or ord(char)==32 or ord(char)==45:<BR> word= word + char <BR> word=string.split(word, "--")<BR> word=string.join(word, " ")<BR> word=word.replace (" ", " ")<BR> word=string.split(word, " ")<BR> return word<BR> <BR>if __name__ == '__main__':<BR> import doctest<BR> doctest.testmod()<BR>
<BR>
But now I wonder if this can be done more easerly ?<BR>
<BR>
Roelof<BR>
<BR>                                            </body>
</html>