comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos" <david.c.hoos.sr@ada95.com>
Subject: Re: character matching
Date: Fri, 13 Aug 2004 05:33:03 -0500
Date: 2004-08-13T05:33:03-05:00	[thread overview]
Message-ID: <pL0Tc.9384$Yh.6483@bignews3.bellsouth.net> (raw)
In-Reply-To: gcYSc.818$Y24.419@cyclops.nntpserver.com

Look into the GNAT.Regpat package which does pattern matching
of the sort you describe, and more.

"John J" <g_001@hotmail.com> wrote in message
news:gcYSc.818$Y24.419@cyclops.nntpserver.com...
> To develop a program that counts words and sentences I'm trying to write
> some code that will recognise a word due to it being a series of
> alphanumeric characters terminated by one or more of a space, comma,
> fullstop, colon, exclamation mark or question mark. I'm going to use a
case
> to match the condition then perform an advance on a wordcounter.
>
> I also need to include a case match that will recognise sentences by being
a
> sequence of words terminated by one or more of full stop, exclamation
mark,
> question mark or colon. The code also needs to be able to accept that
there
> maybe spaces between the last word of the sentence and the terminating
stop
> ie. "hope this works  !". I'm not sure on how to match these conditions
and
> would greatly appreciate some assistance. My skeletion code is as follows:
>
> case input(Character) is
>     when ???????       -- find word
>         Word_Count:= Word_Count + 1.0;
>     when ??????        -- find sentence
>         Sentence_Count:= Sentence_Count + 1.0;
> end case;
>
> Thanks for any help
>
>
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada-france.org
> http://www.ada-france.org/mailman/listinfo/comp.lang.ada
>
>




  reply	other threads:[~2004-08-13 10:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-13  5:23 character matching John J
2004-08-13 10:33 ` David C. Hoos [this message]
2004-08-13 11:12 ` Nick Roberts
2004-08-13 18:41 ` Jeffrey Carter
2004-08-15 12:36 ` John J
2004-08-15 14:52   ` Ludovic Brenta
2004-08-15 21:02     ` Adrian Knoth
2004-08-16 22:26       ` Ludovic Brenta
2004-08-15 17:21   ` Steve
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox