From: 7stud -- Date: 2009-07-22T09:44:54+09:00 Subject: Re: Trouble Counting Words, Sentences and Paragraphs Max Norman wrote: > 7stud -- wrote: >> Max Norman wrote: >>> Unfortunately, I've run into trouble: the >>> numbers don't seem to be coming out right. >>> >> >> What are your suspicions? > > My concern stems from the paragraph count: the application reports only > two paragraphs, but the document is segmented into a score more. The code defines a paragraph as two consecutive newlines, which would look like this: hello world. other text. goodbye world. other text. This is what your text file looks like to me: {\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 {\fonttbl\f0\fnil\fcharset0 Verdana;} {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww9000\viewh8400\viewkind0 \deftab720 \pard\pardeftab720\ql\qnatural \f0\fs24 \cf0 Among other public buildings in a certain town, which for many reasons it will be prudent to refrain from mentioning, and to which I will assign no fictitious name, there is one anciently common to most towns, great or small: to wit, a workhouse; and in this workhouse was born; on a day and date which I need not trouble myself to repeat, inasmuch as it can be of no possible consequence to the reader, in this stage of the business at all events; the item of mortality whose name is prefixed to the head of this chapter.\ \ For a long time after it was ushered into this world of sorrow and trouble, by the parish surgeon, it remained a matter of considerable doubt whether.. -- Posted via http://www.ruby-forum.com/.