<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;">
&gt; I tried your suggestion with strip and it looks like this :<br>
&nbsp;<br>
&gt; import string<br><br>You don't need this now<br><br>
&gt; def extract_words(s):<br>&gt;&nbsp;&nbsp;&nbsp; word= ""<br><br>You dont need this<br><br>&gt;&nbsp; &nbsp;&nbsp; s2=[]<br>&gt;&nbsp; &nbsp;&nbsp; s = string.lower(s)<br>&gt;&nbsp; &nbsp;&nbsp; s = s.replace( "--", " ")<br><br>You probably don't need this either - just add '-' to the strip set.<br><br>&gt;&nbsp; &nbsp;&nbsp; s = s.split()<br>&gt;&nbsp; &nbsp;&nbsp; for word in s:<br><br>And you could combine those to<br><br>for word in s.split():<br><br>&gt;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test = word <br>&gt;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test = word.strip('!?,.')<br><br>You don't need test, just use<br><br>word = word.strip('!?",.-')&nbsp; #added " and - to your set...<br><br>&gt;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s2.append(test)<br>&gt;&nbsp; &nbsp;&nbsp; return s2<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&gt; It works well only I can't&nbsp;get&nbsp;it to work&nbsp;the strip with ". <br>&gt; I always get
 a&nbsp;EOF error&nbsp;message. I tried it with <br>&gt; 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>