From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,bb6ebeb41bf44573,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed-east.nntpserver.com!nntpserver.com!cyclops.nntpserver.com.POSTED!918e67f8!not-for-mail From: "John J" Newsgroups: comp.lang.ada Subject: character matching X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: NNTP-Posting-Date: Fri, 13 Aug 2004 00:20:12 EST Date: Fri, 13 Aug 2004 14:53:07 +0930 Xref: g2news1.google.com comp.lang.ada:2708 Date: 2004-08-13T14:53:07+09:30 List-Id: 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