[Examples] Count of characters and words

Demos, code samples. Only questions related to the existing topics are allowed here.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I suggest to get a text string using the functions from RVLinear.pas (they are better because they just insert a character in place of non-text items, except for tabs and tables) and use it to calculate this statistics.
Pieter E.
Posts: 835
Joined: Sun Aug 28, 2005 9:34 am

Post by Pieter E. »

Is it possible to count sentences instead of lines?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

How do you define a sentence?

For example, if a line contains a single word, is this a sentence?
Pieter E.
Posts: 835
Joined: Sun Aug 28, 2005 9:34 am

Post by Pieter E. »

Good question. :D

A sentence ends with '.', ':' and ';'?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Line breaks inside a sentence? Pictures? Tables?
Pieter E.
Posts: 835
Joined: Sun Aug 28, 2005 9:34 am

Post by Pieter E. »

All three options seems reasonable. :D
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Still not clear :)

If a table is allowed inside a sentence... What if this table cells contains several sentences?

Actually, I suggest the following way of calculation. Get text using RVGetTextRange(rv, 0, RVGetTextLength(rv)) (from RVLinear unit) and calculate sentences in this text.
Pieter E.
Posts: 835
Joined: Sun Aug 28, 2005 9:34 am

Post by Pieter E. »

Thank you for your suggestion. I'll look into this. :D
Post Reply