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

Restore words that were missing in lowfat dataset #117

Merged
merged 17 commits into from
Apr 10, 2024

Conversation

jonathanrobie
Copy link
Contributor

Simplified Lowfat query for Hebrew. Fixes these errors:

  • Lowfat now contains all Hebrew words, some were missing.
  • Lowfat words are now in the same order as in Nodes.
  • @Head attribute is present when @Head=true

Analysis is different than previously. Over time, we should consider when to restore rules-based logic.

@jacobwegner
Copy link
Collaborator

@jonathanrobie: I took a look at this tonight and have a couple of notes:

  • I removed the xfail decorator, so now the test that counts the number of nodes passes again 🎉
  • There failures now that @class has been removed from some w elements.

I don't think that removing @class as intentional, but if it was, let me know, and we can adjust the test suite to match.

I noticed that the version of the transform on main had used $node/ancestor::Node[1]/@Cat ! attribute class {.}:

1e8a8df#diff-291da101c14c773a2f87ecb73479d4bacfdd5064cea7cfb6a7773fa2fb43af48L216

and that the latest version of the transform uses $node/@Cat ! attribute class {lower-case(.)}

1e8a8df#diff-291da101c14c773a2f87ecb73479d4bacfdd5064cea7cfb6a7773fa2fb43af48R216

main:

this branch:

strongnumberx="2050b"

If this is not as expected (and we want all w elements to have @class attrs), I think the patch below would fix it:

diff --git a/mappings/lowfat-macula-hebrew.xquery b/mappings/lowfat-macula-hebrew.xquery
index bd0b5545..5066aeed 100644
--- a/mappings/lowfat-macula-hebrew.xquery
+++ b/mappings/lowfat-macula-hebrew.xquery
@@ -212,8 +212,11 @@ declare function local:attributes($node)
 	$node/parent::Node/@GreekStrong ! attribute greekstrong {.},
 	$node/parent::Node/@StrongNumberX ! attribute strongnumberx {.},
 	$node/parent::Node/@Unicode ! attribute unicode {.},
-		
-	$node/@Cat ! attribute class {lower-case(.)},
+
+	if ($node/@Cat) then
+		attribute class {lower-case($node/@Cat)}
+	else
+		attribute class {lower-case($node/parent::Node/@Cat)},
 			
 	$node/@Rule ! attribute rule {.},
 	$node/@Unicode ! attribute unicode {.},

(This is just my shot at it; feel free to solve it another way!)

@jonathanrobie
Copy link
Contributor Author

Yes, @class needs to be there, and your code looks right.

@jacobwegner jacobwegner changed the title restore words lowfat Restore words that were missing in lowfat dataset Apr 10, 2024
@jacobwegner jacobwegner merged commit fd8e548 into main Apr 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants