Re: character counter

2008-01-09 Thread Alfredo Braunstein
Andre Poenitz wrote: > On Wed, Jan 09, 2008 at 09:59:40AM +0100, Alfredo Braunstein wrote: >> Pavel Sanda wrote: >> >> >> Yep, seems perfect, and it should be faster than the other version. >> >> Note >> > >> > unfortunately both std::distance and fun below hangs when counting >> > inside select

Re: character counter

2008-01-09 Thread Alfredo Braunstein
Pavel Sanda wrote: >> > unfortunately both std::distance and fun below hangs when counting >> > inside selection. anybody idea whats going wrong? >> >> I think so. If the two ParIterators point to the same paragraph, the loop >> shouldn't be entered (so there is an off by one error arguably). >>

Re: character counter

2008-01-09 Thread Andre Poenitz
On Wed, Jan 09, 2008 at 09:59:40AM +0100, Alfredo Braunstein wrote: > Pavel Sanda wrote: > > >> Yep, seems perfect, and it should be faster than the other version. Note > > > > unfortunately both std::distance and fun below hangs when counting inside > > selection. anybody idea whats going wrong?

Re: character counter

2008-01-09 Thread Jean-Marc Lasgouttes
Uwe Stöhr <[EMAIL PROTECTED]> writes: >> then lets wait on some users scream ;) > > I herby do ;-) > > When Word lists the number of paragraphs, I'm sure this will be used. > I can imagine of stupid rules, not to have more than a certain number > of paragraphs. This is not what google tels me :)

Re: character counter

2008-01-09 Thread Uwe Stöhr
> then lets wait on some users scream ;) I herby do ;-) When Word lists the number of paragraphs, I'm sure this will be used. I can imagine of stupid rules, not to have more than a certain number of paragraphs. At the moment you are close to get it to work. Implementing this later requires wo

Re: character counter

2008-01-09 Thread Pavel Sanda
> > i'll add the few coments of != to wiki. > > is a FIXME in the source not better? added p

Re: character counter

2008-01-09 Thread Jean-Marc Lasgouttes
Pavel Sanda <[EMAIL PROTECTED]> writes: >> I am not really sure we want the paragraph count... > > then lets wait on some users scream ;) This is what I would do. FWIW, I did some google-voting for different expressions: word.count: 7 770 000 entries character.count: 813 000 entries paragraph

Re: character counter

2008-01-09 Thread Pavel Sanda
> I am not really sure we want the paragraph count... then lets wait on some users scream ;) pavel

Re: character counter

2008-01-09 Thread Jean-Marc Lasgouttes
Pavel Sanda <[EMAIL PROTECTED]> writes: > thanks for the explanation. now i understand why one more forwardPar fixed > the problems. if you can verify the patch from yesterday we can put the > paragraphs count in. otherwise we will let it sleep in the current state > untill some users start to de

RE: character counter

2008-01-09 Thread Leuven, E.
> i'll add the few coments of != to wiki. is a FIXME in the source not better?

Re: character counter

2008-01-09 Thread Pavel Sanda
> > unfortunately both std::distance and fun below hangs when counting inside > > selection. anybody idea whats going wrong? > > I think so. If the two ParIterators point to the same paragraph, the loop > shouldn't be entered (so there is an off by one error arguably). > Unfortunately operator!=(P

Re: character counter

2008-01-09 Thread Alfredo Braunstein
Pavel Sanda wrote: >> Yep, seems perfect, and it should be faster than the other version. Note > > unfortunately both std::distance and fun below hangs when counting inside > selection. anybody idea whats going wrong? I think so. If the two ParIterators point to the same paragraph, the loop shou

Re: character counter

2008-01-08 Thread rgheck
Uwe Stöhr wrote: > please can you check whether Word count characters in automatically inserted > chars (like the number of chapter) and pasted TOC? Word counts chapter numbers as word and its characters too: [snip] You can get a more accurate count if you export to plaintext, run the text fil

Paragraph counter (was: Re: character counter)

2008-01-08 Thread Pavel Sanda
> The rest looks good. i commited only chars counting, because unfortunately the paratgraph stuff is more complicated than i thought. i was able to put it in a functional state but really dont know what i'm doing - can somebody with better understanding of xxxIterators review it ? patch below pav

Re: character counter

2008-01-08 Thread Pavel Sanda
> >> What about dit.pos() == 0? > > > > hmm. i tried to bake a new function from the hints you gave in wiki, > > does it seem to be right? > > Yep, seems perfect, and it should be faster than the other version. Note unfortunately both std::distance and fun below hangs when counting inside selec

Re: character counter

2008-01-08 Thread Pavel Sanda
> Wod counts chapter numbers as word and its characters too: i was afraid this is the case and we wont be compatible with the rest of the world ;( > So characters in section heading should be counted in LyX twice when the > user has inserted a TOC in his document, the same for figure and table

Re: character counter

2008-01-08 Thread Jürgen Spitzmüller
Pavel Sanda wrote: > waiting a while for objections. Just two small ones: - I would change the menu entries as well (to "Statistics ..."). - "The selection/document statistics:" sounds odd. I think something like "Statistics for the selection/document" is better. The rest looks good. Jürgen

Re: character counter

2008-01-08 Thread Uwe Stöhr
> please can you check whether Word count characters in automatically inserted > chars (like the number of chapter) and pasted TOC? Word counts chapter numbers as word and its characters too: 12. Test A means 3 words and 10 characters (with spaces), 8 characters (without spaces) The word count

Re: character counter

2008-01-08 Thread Pavel Sanda
> > Attached the patch. Pavel, maybe you can use something of it. > > yes, i will take it. > > > + char_type const c = > > dit.paragraph().getChar(dit.pos()); > > + if (isLetterChar(c) || isDigit(c)) i substituted it by isPrintableNonspace(c).

Re: character counter

2008-01-08 Thread Pavel Sanda
> This will never be accurate, with automatic words like "chapter" my words > in various languages. So why not use "ls -l" (or "dir" in windows) - > just look at the file size. this wont help. .lyx has zilion of \begin_layout, .tex has zilion of others macros, dvi is binary, etc. pavel

Re: character counter

2008-01-08 Thread Alfredo Braunstein
Pavel Sanda wrote: >> What about dit.pos() == 0? > > hmm. i tried to bake a new function from the hints you gave in wiki, > does it seem to be right? Yep, seems perfect, and it should be faster than the other version. Note that you could use ++dit for shortness. Probably even std::distance(from,

Re: character counter

2008-01-08 Thread Helge Hafting
Pavel Sanda wrote: Is there any chance a character counter could be implemented into Lyx? It would be of great help when writing university papers such counter is quite simple. do we want it ? Absolutely! It was reported that this is a killer feature in some fields: this wil

Re: character counter

2008-01-08 Thread Pavel Sanda
> Attached the patch. Pavel, maybe you can use something of it. yes, i will take it. > + char_type const c = > dit.paragraph().getChar(dit.pos()); > + if (isLetterChar(c) || isDigit(c)) i dont understand this one - why eg '\' is not counte

Re: character counter

2008-01-08 Thread Pavel Sanda
Hi Alfredo :) > > chrrm, is there an easy way how to recognize paragraph begining inside the > > loop for (DocIterator dit = from ; dit != to ; dit.forwardPos()) > > ? > > What about dit.pos() == 0? hmm. i tried to bake a new function from the hints you gave in wiki, does it seem to be right?

Re: character counter

2008-01-08 Thread Alfredo Braunstein
Pavel Sanda wrote: Hi Pavel, > chrrm, is there an easy way how to recognize paragraph begining inside the > loop for (DocIterator dit = from ; dit != to ; dit.forwardPos()) > ? What about dit.pos() == 0? A/

Re: character counter

2008-01-08 Thread Jürgen Spitzmüller
Uwe Stöhr wrote: >  > this will be only informative counter. one reason is the different views >  > what is to be counted, > > LyX should display the following (as Word and other word processors do): > > - number of words > - number of characters except spaces > - number of characters including spa

Re: character counter

2008-01-08 Thread Pavel Sanda
> > this will be only informative counter. one reason is the different views > > what is to be counted, > > LyX should display the following (as Word and other word processors do): please can you check whether Word count characters in automatically inserted chars (like the number of chapter) and p

Re: character counter

2008-01-08 Thread Uwe Stöhr
> this will be only informative counter. one reason is the different views > what is to be counted, LyX should display the following (as Word and other word processors do): - number of words - number of characters except spaces - number of characters including spaces - number of paragraphs > th

Re: character counter

2008-01-07 Thread Martin Vermeer
On Tue, Jan 08, 2008 at 12:46:18AM +0100, Andre Poenitz wrote: > On Mon, Jan 07, 2008 at 11:08:11PM +0100, Pavel Sanda wrote: > > > > Is there any chance a character counter could be implemented into Lyx? > > > > It > > > > would be of great help when writing university papers > > > > > > > such c

Re: character counter

2008-01-07 Thread Andre Poenitz
On Mon, Jan 07, 2008 at 11:08:11PM +0100, Pavel Sanda wrote: > > > Is there any chance a character counter could be implemented into Lyx? It > > > would be of great help when writing university papers > > > > > such counter is quite simple. do we want it ? > > > > Absolutely! It was reported that t

Re: character counter

2008-01-07 Thread Pavel Sanda
> > Is there any chance a character counter could be implemented into Lyx? It > > would be of great help when writing university papers > > > such counter is quite simple. do we want it ? > > Absolutely! It was reported that this is a killer feature in some fields: this will be only informative c

Re: character counter

2008-01-07 Thread Uwe Stöhr
> Is there any chance a character counter could be implemented into Lyx? It > would be of great help when writing university papers > such counter is quite simple. do we want it ? Absolutely! It was reported that this is a killer feature in some fields: In Germany expertises are sold by the amo

Re: character counter

2008-01-07 Thread rgheck
McFisto McFist wrote: On Jan 7, 2008 8:50 PM, Richard Heck <[EMAIL PROTECTED] > wrote: McFisto McFist wrote: > Hello, hopefully this is the right place for this. > > Is there any chance a character counter could be implemented into Lyx? It >

Re: character counter

2008-01-07 Thread Abdelrazak Younes
Pavel Sanda wrote: Is there any chance a character counter could be implemented into Lyx? It would be of great help when writing university papers such counter is quite simple. do we want it ? Why not? You'll have to modify the relevant dialog accordingly. Abdel.

Re: character counter

2008-01-07 Thread Pavel Sanda
> Is there any chance a character counter could be implemented into Lyx? It > would be of great help when writing university papers such counter is quite simple. do we want it ? pavel diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 19e16da..bfd87fb 100644 --- a/src/BufferView.cpp +++ b/

Re: character counter

2008-01-07 Thread Richard Heck
McFisto McFist wrote: Hello, hopefully this is the right place for this. Is there any chance a character counter could be implemented into Lyx? It would be of great help when writing university papers There is a word counter. Your teachers count characters? rh