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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,97643ec695b9bf73 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-12 04:57:55 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!chcgil2-snh1.gtei.net!news.bbnplanet.com!nycmny1-snf1.gtei.net!news.gtei.net!colt.net!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.tiscali.de!newsfeed.freenet.de!fr.ip.ndsoftware.net!teaser.fr!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "amado.alves" Newsgroups: comp.lang.ada Subject: RE: Word counting Date: Fri, 12 Dec 2003 12:56:35 -0000 Organization: Cuivre, Argent, Or Message-ID: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: melchior.cuivre.fr.eu.org 1071233803 13783 80.67.180.195 (12 Dec 2003 12:56:43 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Fri, 12 Dec 2003 12:56:43 +0000 (UTC) To: Return-Path: X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message Thread-Topic: Word counting Thread-Index: AcPAlsqbdbkz0pWWS/iqojy4SOkXPwAFrUt5 X-OriginalArrivalTime: 12 Dec 2003 12:56:36.0371 (UTC) FILETIME=[6048F630:01C3C0AF] X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.3 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:3413 Date: 2003-12-12T12:56:35+00:00 << While not the end of the file Read the next line from the file Move the cursor one place and if character is within a..Z = boundaries that character is stored in an array word_length(number) for that word length if the chracter is a space, then we've hit the end of that word length so increment our word length to search for by 1 (number). we've also hit the end of a word to increment our word count. End of loop; >> =20 This logic still has faults. Consider: =20 LET WORD_COUNT BE AN ARRAY OF MAX_LENGTH INTEGERS, ALL SET TO ZERO While not the end of the file Read the next line from the file LOOP GET NEXT WORD IF NONE, EXIT LOOP INCREMENT WORD_COUNT (LENGTH OF WORD) BY 1 END OF LOOP End of loop; When you see the prior faults and how they were solved here call back. =20