Bug 149955 - word count is counting wrong
Summary: word count is counting wrong
Status: RESOLVED WORKSFORME
Alias: None
Product: kile
Classification: Applications
Component: general (show other bugs)
Version: trunk-kde4
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Michel Ludwig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-18 01:33 UTC by Simon
Modified: 2023-02-01 05:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon 2007-09-18 01:33:21 UTC
Version:           1.9.3 (using KDE KDE 3.5.7)
Installed from:    Gentoo Packages
Compiler:          x86_64-pc-linux-gnu-4.1.2 
OS:                Linux

I'm doing some arrangements for my upcoming bachelor thesis and for this i need the word count function. But i figured out that this functions is not working well, well beter then other but not exact enough. There are more words then there should be i have a simple project with ~108 words (manualy counted) but your statiscs are counting 142. So i watched where this should come from.
Here this is my main .tex file:

\input{preamble}
\begin{document}
 \include{titlepage}
 \include{dedication}
 \include{contents}
 \include{chapter1}
\end{document}

and the counter is telling me that there are 5 words in it...
same is happening with commands like:

\usepackage[left=4cm,top=2cm,right=2cm,bottom=2cm]{geometry}

these are actually 9 words.
other commands that are similar:
\documentclass
\pagestyle
\automark

and perhaps more that i have not found in my project.
Comment 1 Thomas Braun 2007-09-19 18:34:02 UTC
Hello,

well it is not very accurate but that is because of the way latex works.
Consider e.g. two cases:
1.) \usepackage{graphicx} this should not be counted as one word.
2.) but \textbf{stuff} should be counted as one word.

But how should kile know if the stuff in brakets are real words or only options?
A hardcoded list of latex commands would be a lot of work and will also fail as soon as you start to use newcommands.

If you got any ideas how to reliable improve it, don't hesitate to tell us.

Thomas

PS: I'm not sure which ps/pdf viewers have a reliable word count.
Comment 2 Simon 2007-09-19 20:20:42 UTC
If I would known something then I would told you, but its not that easy. even other methods like: creating the pdf then pdftotext and then wc arent that good especially if you have a ToC with dots (every dot is counted as a word).

I think there is no easy way to implement this. But there are some geniuses out there perhaps they can help.
Comment 3 Simon 2007-10-20 03:23:18 UTC
I thought a little about it, perhaps a blacklist with the ability to add new regular expressions would do the job.
e.g.
a list at the statistic window where I can add(or enable/disable) something like:

- \begin{.*}
- \end{*}
or even something complexer:
- \begin{tikzpicture}*\end{tikzpicture}

and then the counter will ignore everything which matches those reg. exp.
This is the best way which I can think of this far.
Comment 4 Andrew Crouthamel 2018-11-11 04:23:13 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Andrew Crouthamel 2018-11-21 04:21:39 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Justin Zobel 2023-01-02 07:43:34 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 7 Bug Janitor Service 2023-01-17 05:13:58 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 8 Bug Janitor Service 2023-02-01 05:03:39 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!