<!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> </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> </DIV>
<DIV><FONT color=#000080>Yes, this is an interesting problem and here is the
requirement:</FONT></DIV>
<DIV><FONT color=#000080></FONT> </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>- 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 > 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> </DIV>
<DIV><FONT color=#000080>How did I solve it? 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. 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> </DIV>
<DIV><FONT color=#000080>Cheers!</FONT></DIV>
<DIV><FONT color=#000080></FONT> </DIV>
<DIV><FONT color=#000080>Dinesh</FONT></DIV>
<DIV><FONT color=#000080></FONT> </DIV>
<DIV>
<HR>
</DIV>
<DIV>Date: Sun, 1 Jun 2008 21:56:26 -0400<BR>From: "Kent Johnson" <<A
href="mailto:kent37@tds.net">kent37@tds.net</A>><BR>Subject: Re: [Tutor]
finding special character string<BR>To: "Marilyn Davis" <<A
href="mailto:marilyn@deliberate.com">marilyn@deliberate.com</A>><BR>Cc: <A
href="mailto:tutor@python.org">tutor@python.org</A><BR>Message-ID:<BR><<A
href="mailto:1c2a2c590806011856x1875665ep690353c7c2ebc3da@mail.gmail.com">1c2a2c590806011856x1875665ep690353c7c2ebc3da@mail.gmail.com</A>><BR>Content-Type:
text/plain; charset=ISO-8859-1<BR><BR>On Sun, Jun 1, 2008 at 9:41 PM, Marilyn
Davis <<A href="mailto:marilyn@deliberate.com">marilyn@deliberate.com</A>>
wrote:<BR><BR>> Yeh, we need a better spec. I was wondering if the stuff
between the text<BR>> ought not include white space, or even a word
boundary. A character class<BR>> might be better, if we
knew.<BR><BR>Hmm, yes, my regex will find many ordinary sentences in plain
text.<BR><BR>> 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> </DIV></BODY></HTML>