-
Notifications
You must be signed in to change notification settings - Fork 1
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
test for style inheritance #2
base: ocrd-page-patch-inheritance
Are you sure you want to change the base?
test for style inheritance #2
Conversation
- update links under _See Also_, add specific link for API documentation - update required Python version
Update README.md
Oops, no – not at all. I was worried about that effect as well, but IIRC did not see it in my tests and thereby felt safe. However, I don't even understand why you say this only works after serializing and reparsing. The But indeed, now looking at the export routines, I fail to see how this is supposed to not make the expanded inheritance persistent... |
Oh, now I get it. What you meant is from the other side – what if I modify an object myself, how can I make the inheritance visible immediately? (So this actually applies to the setters – but since generateDS does not produce a strict setter API without direct access, and lazy programmers (=all programmers) therefore do not use setters, we cannot rely on that mechanism for patching.) I have no simple answer for that. But I would argue that it's not a real issue.
Do you have an answer to that perhaps? |
True, but it does not get called when modifying the tree, e.g. adding elements to it, cf. https://github.com/bertsky/core/pull/2/files#diff-b4a75f642caae6a97596456f2ea64e086f91798216555f54e4b5e63b535a679aR358 |
No, sorry, besides implementing the behavior completely dynamic, i.e. in the |
Yes, indeed. In principle in our patch we could introduce new hidden attributes that allow differentiating implicit and explicit members, but I would rather not go there. But we could attack the problem from the other side: (maximally) unexpanding inheritance during export. This could still deviate from the input (making explicit but redundant settings disappear). It would likely cost some performance as well. Maybe we should make this behaviour optional with a kwarg, say
|
That's a great idea and it not only adresses the issue of accessing style inheritance but also improves the consistency of existing PAGE-XML. We obviously must document this well but I think the |
Ok, if you think so. But let's hear some other perspectives in the Tech Call. |
For some reason I could not push to the branch behind OCR-D#700.
I added a test to verify the functionality. I was a bit confused at first because I assumed inheritance was built into the getters as well but then I realized that it's only added to the
build
method, so only works after serialiazing and parsing again. One thing that bothers me slightly is that this means that the inheritance is made explicit after serializing the results again, i.e. you end up with a lot of duplicatedprimaryLanguage
,TextStyle
etc. - is that the intended effect?