<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#000080>Yes, I'm happy because I found a non-regex way to solve 
the problem (see below).</FONT></DIV>
<DIV><FONT color=#000080></FONT>&nbsp;</DIV>
<DIV><FONT color=#000080>No, I'm not a student or worn out but wish I was back 
at college and partying!</FONT></DIV>
<DIV><FONT color=#000080></FONT>&nbsp;</DIV>
<DIV><FONT color=#000080>Yes, this is an interesting problem and here is the 
requirement:</FONT></DIV>
<DIV><FONT color=#000080></FONT>&nbsp;</DIV>
<DIV><FONT color=#000080>- A text document contains special words that start and 
end with a period ("."), the word between the start and end periods contain no 
punctuation or spaces except a hyphen in some special words.</FONT></DIV>
<DIV><FONT color=#000080>- Examples of special words include "</FONT><FONT 
color=#000080>.thrfore.", ".because.", '.music-sharp.", ".music-flat.", ".dbd.", 
".vertline.", ".uparw.", ".hoarfrost." etc.</FONT></DIV>
<DIV><FONT color=#000080>- In most cases, the special words have a space (" ") 
before and after.</FONT></DIV>
<DIV><FONT color=#000080>- In some cases, a special word will be followed by one 
or two other special words eg. ".dbd..vertline." or 
".music-flat..dbd..vertline."</FONT></DIV>
<DIV><FONT color=#000080>- In some cases, a special word will be followed by an 
ordinary word (with or without punctuation) eg. ".music-flat.mozart" or 
".vertline.isn't"</FONT></DIV>
<DIV><FONT color=#000080>-&nbsp;A special word followed by an ordinary word 
(with or without punctuation) could be the end of a sentence and hence have a 
full-stop (".") eg. ".music-flat.mozart." or ".vertline.isn't."</FONT></DIV>
<DIV><FONT color=#000080>- The number of characters in a special word excluding 
the two periods is &gt; 1</FONT></DIV>
<DIV><FONT color=#000080>- Find and remove all special words from the text 
document (by processing one line at a time)</FONT></DIV>
<DIV><FONT color=#000080></FONT>&nbsp;</DIV>
<DIV><FONT color=#000080>How did I solve it?&nbsp; I found a list of all the 
special words, created a set of special words and then checked if each word in 
the text belonged to the set of special words.&nbsp; If we assume that the list 
of special words doesn't exist then the problem is interesting in itself to 
solve.</FONT></DIV>
<DIV><FONT color=#000080></FONT>&nbsp;</DIV>
<DIV><FONT color=#000080>Cheers!</FONT></DIV>
<DIV><FONT color=#000080></FONT>&nbsp;</DIV>
<DIV><FONT color=#000080>Dinesh</FONT></DIV>
<DIV><FONT color=#000080></FONT>&nbsp;</DIV>
<DIV>
<HR>
</DIV>
<DIV>Date: Sun, 1 Jun 2008 21:56:26 -0400<BR>From: "Kent Johnson" &lt;<A 
href="mailto:kent37@tds.net">kent37@tds.net</A>&gt;<BR>Subject: Re: [Tutor] 
finding special character string<BR>To: "Marilyn Davis" &lt;<A 
href="mailto:marilyn@deliberate.com">marilyn@deliberate.com</A>&gt;<BR>Cc: <A 
href="mailto:tutor@python.org">tutor@python.org</A><BR>Message-ID:<BR>&lt;<A 
href="mailto:1c2a2c590806011856x1875665ep690353c7c2ebc3da@mail.gmail.com">1c2a2c590806011856x1875665ep690353c7c2ebc3da@mail.gmail.com</A>&gt;<BR>Content-Type: 
text/plain; charset=ISO-8859-1<BR><BR>On Sun, Jun 1, 2008 at 9:41 PM, Marilyn 
Davis &lt;<A href="mailto:marilyn@deliberate.com">marilyn@deliberate.com</A>&gt; 
wrote:<BR><BR>&gt; Yeh, we need a better spec. I was wondering if the stuff 
between the text<BR>&gt; ought not include white space, or even a word 
boundary.&nbsp; A character class<BR>&gt; might be better, if we 
knew.<BR><BR>Hmm, yes, my regex will find many ordinary sentences in plain 
text.<BR><BR>&gt; Anyhow, I think we wore out the student. :^)<BR><BR>He went 
away happy after my first reply.<BR><BR>Kent<BR><BR></DIV>
<DIV><FONT color=#000080></FONT>&nbsp;</DIV></BODY></HTML>