[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newsfeed and Local Weather (fwd)



The example kind of amused me.

From: Tom Christiansen <[email protected]>
Newsgroups: comp.lang.perl.misc
Subject: Re: Newsfeed and Local Weather
Date: 4 May 1999 15:59:30 -0700

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    [email protected] (Kai Henningsen) writes:
:TwospacestoseparatesentencesisasillyEnglish-languageconceitanyway.Real
:languagesdon'tneedthis.

You're wrong.  It's so you can parse one sentence to the next.  Otherwise,
you have to do a real parse, which is damned rough to program.  This
way sentential analysis and manipulation are feasible.  Without the
habit, it is virtually hopeless.  

Here is one sentence:

    I heard that you live next to Susan St. James, who told me to call
    early, but you weren't home yet.

Here are two sentences:

    I heard that you live next to Susan St.  James, who told me to call
    early, thought you would be home already.

Note the difference.  Now, please write a regular expression that 
can tell the two apart.

Good, now remove the double-space between the two sentences in the
second example and show me the pattern that can tell the difference.

'Nuff said.  Tip: learn the ( and ) target movement commands in vi.  Then
you can do cool things like 3d) to delete three sentences.

--tom
-- 
"Software Engineers are like economists." --Rob Pike
===
This message was sent to mph-humor.  No guarantees of actual humor are
provided.  Archives and instructions are available from
<http://www.pobox.com/~mph/humor/>.