Skip to content

Fix double mappings handling and expand trailing paragraph marker definition - #521

Merged
Enkidu93 merged 3 commits into
masterfrom
fix-usfm-conversion-bugs
Sep 28, 2026
Merged

Enkidu93 merged 3 commits into
masterfrom
fix-usfm-conversion-bugs

Conversation

@Enkidu93

@Enkidu93 Enkidu93 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #517, #518.


This change is Reviewable

@codecov-commenter

codecov-commenter commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.34%. Comparing base (b240b7b) to head (52463f3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #521      +/-   ##
==========================================
+ Coverage   74.33%   74.34%   +0.01%     
==========================================
  Files         456      456              
  Lines       38249    38261      +12     
  Branches     5237     5242       +5     
==========================================
+ Hits        28432    28445      +13     
  Misses       8666     8666              
+ Partials     1151     1150       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ddaspit ddaspit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed two fixes.

@ddaspit reviewed 2 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on Enkidu93 and pmachapman).


tests/SIL.Machine.Tests/Corpora/ConvertUsfmVersificationHandlerTests.cs line 977 at r3 (raw file):

        string[] targetLines = target.Split('\n');
        string[] truthLines = truth.Split('\n');
        // Assert.That(targetLines.Length, Is.EqualTo(truthLines.Length));

Nit: did you mean to comment this out?

@pmachapman pmachapman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: This worked well for my test projects.

@pmachapman reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on Enkidu93).

@Enkidu93
Enkidu93 force-pushed the fix-usfm-conversion-bugs branch from e69e44e to 9171d13 Compare September 28, 2026 14:15
Enkidu93 and others added 3 commits September 28, 2026 17:27
When a verse range started with a verse that was already written, the
whole range marker was dropped, merging later verses into the previous
one. Now only the duplicated verse is suppressed and the rest of the
range is still written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preserved trailing paragraph markers collected before a verse that is
not kept were flushed at the next kept verse, producing stray empty
paragraphs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Enkidu93
Enkidu93 force-pushed the fix-usfm-conversion-bugs branch from 9171d13 to 52463f3 Compare September 28, 2026 21:27
@Enkidu93
Enkidu93 merged commit f2ca324 into master Sep 28, 2026
5 of 6 checks passed
@Enkidu93
Enkidu93 deleted the fix-usfm-conversion-bugs branch September 28, 2026 21:48
ddaspit added a commit to sillsdev/machine.py that referenced this pull request Oct 1, 2026
Port sillsdev/machine#472 and the follow-up fixes from sillsdev/machine#521.
ParatextProjectTextUpdaterBase.update_usfm now converts the source USFM to the
rows' versification when it differs from the project's, using the new
ConvertUsfmVersificationHandler.

The test project settings now default to English versification, matching
ScriptureRef, so existing update tests do not trigger a conversion.

Closes #369
Closes #382

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Damien Daspit <3261883+ddaspit@users.noreply.github.com>
ddaspit added a commit to sillsdev/machine.py that referenced this pull request Oct 1, 2026
Port sillsdev/machine#472 and the follow-up fixes from sillsdev/machine#521.
ParatextProjectTextUpdaterBase.update_usfm now converts the source USFM to the
rows' versification when it differs from the project's, using the new
ConvertUsfmVersificationHandler.

The test project settings now default to English versification, matching
ScriptureRef, so existing update tests do not trigger a conversion.

Closes #369
Closes #382

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Damien Daspit <3261883+ddaspit@users.noreply.github.com>
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.

ConvertUsfmVersificationHandler doesn't merge verses correctly

4 participants