<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
> I tried your suggestion with strip and it looks like this :<br>
<br>
> import string<br><br>You don't need this now<br><br>
> def extract_words(s):<br>> word= ""<br><br>You dont need this<br><br>> s2=[]<br>> s = string.lower(s)<br>> s = s.replace( "--", " ")<br><br>You probably don't need this either - just add '-' to the strip set.<br><br>> s = s.split()<br>> for word in s:<br><br>And you could combine those to<br><br>for word in s.split():<br><br>> test = word <br>> test = word.strip('!?,.')<br><br>You don't need test, just use<br><br>word = word.strip('!?",.-') #added " and - to your set...<br><br>> s2.append(test)<br>> return s2<br> <br>> It works well only I can't get it to work the strip with ". <br>> I always get
a EOF error message. I tried it with <br>> word.strip('!?,.") and with word.strip('!?,./"'') but no go.<br><br>It looks like you are mixing quote styles.<br>Notice how I included the " in the strip() above... <br>See if that works for you.<br></div></div><br>Alan G.<br><br></div></body></html>