Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

category stats not being calculated #557

Closed
desb42 opened this issue Aug 22, 2019 · 3 comments
Closed

category stats not being calculated #557

desb42 opened this issue Aug 22, 2019 · 3 comments

Comments

@desb42
Copy link
Collaborator

desb42 commented Aug 22, 2019

looking at en.wiktionary.org/wiki/Category:English_conjunctions
Mediawiki has
cats3
The Table of Contents (high lit in red) does not appear in xowa

Investigating, the wikitext points to Template:Poscatboiler
This in turn calls Module:Category_tree
This contains the line:

inCategory = mw.site.stats.pagesInCategory(titleText, "pages")

which is returning 0 in xowa (hence no TOC)

The issue is that titleText in this case is English conjunctions (note the space character)

In 400_xowa\src\gplx\xowa\xtns\scribunto\libs\Scrib_lib_site.java
in the function PagesInCategory
the line

ctg_name = Bry_.Replace(ctg_name, Byte_ascii.Space, Byte_ascii.Underline);

needs to be added just after

byte[] ctg_name = args.Pull_bry(0);

so as the next steps can find the entry in the page table

@gnosygnu
Copy link
Owner

Cool. Great info. Thanks for tracking that down; I know it isn't easy. I figure it must have taken at least an hour or so on your side.

On my side, I made the change (and added a test). I ended up using ctg_name = ctg_ttl.Page_db(); to handle other possible normalizations.

Let me know if anything else.

Thanks!

@gnosygnu gnosygnu added this to To do in A <div> in D Aug 22, 2019
@gnosygnu gnosygnu moved this from To do to Done in A <div> in D Aug 22, 2019
@desb42
Copy link
Collaborator Author

desb42 commented Aug 22, 2019

I did not time myself; however, that seems about right.
I find constructing a lucid issue itself can be quite time consuming
The space/underscore issue has nipped in the past

@gnosygnu
Copy link
Owner

I did not time myself; however, that seems about right.

Yeah, from my prior experience, 1 hour is the low estimate in terms of finding the root cause. Sounds like you're just as good navigating the XOWA code base as me. ;)

I find constructing a lucid issue itself can be quite time consuming

Feel free to go light on details. It's amazing enough that you find these issues and track down the cause. Please don't spend time trying to make the issue lucid. If you give me a simple "this is the bug" and "this is my proposed fix" I should be able to figure out the rest. If not, well, I'll ask questions. :)

The space/underscore issue has nipped in the past

Yeah, I try to be mindful of it when coding, but a few cases slip through. Hopefully it's very few

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment