Skip to content

Better USFM versification analysis#432

Merged
Enkidu93 merged 3 commits into
masterfrom
better_usfm_versification_analysis
Jun 25, 2026
Merged

Better USFM versification analysis#432
Enkidu93 merged 3 commits into
masterfrom
better_usfm_versification_analysis

Conversation

@Enkidu93

@Enkidu93 Enkidu93 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes #405
Partially fixes #416


This change is Reviewable

@Enkidu93 Enkidu93 requested a review from ddaspit June 18, 2026 19:42

@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.

@ddaspit partially reviewed 10 files and all commit messages, and made 4 comments.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on Enkidu93).


src/SIL.Machine/Corpora/UsfmVersificationAnalyzer.cs line 16 at r1 (raw file):

    }

    public class UsfmVersificationDiagnostic

Can we make this class immutable, or, at least, immutable externally?


src/SIL.Machine/Corpora/UsfmVersificationAnalyzer.cs line 69 at r1 (raw file):

    }

    public class UsfmVersificationAnalyzer : UsfmParserHandlerBase

I would rename this to UsfmVersificationAnalyzerHandler. I got it confused with the UsfmVersificationAnalyzerBase class.


src/SIL.Machine/Corpora/UsfmVersificationAnalyzerBase.cs line 25 at r1 (raw file):

        public UsfmVersificationAnalysis AnalyzeUsfmVersification(
            HashSet<string> books,

I would rename this to bookIds to differentiate it from the other overloaded method.


src/SIL.Machine/Corpora/UsfmVersificationAnalyzerBase.cs line 36 at r1 (raw file):

        public UsfmVersificationAnalysis AnalyzeUsfmVersification(
            HashSet<int> books,

I would rename this to bookNums.

@codecov-commenter

codecov-commenter commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.15254% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.19%. Comparing base (f9ba7bb) to head (222f51c).

Files with missing lines Patch % Lines
...achine/Corpora/UsfmVersificationAnalyzerHandler.cs 92.04% 13 Missing and 8 partials ⚠️
...L.Machine/Corpora/FileUsfmVersificationAnalyzer.cs 0.00% 4 Missing ⚠️
...IL.Machine/Corpora/ZipUsfmVersificationAnalyzer.cs 0.00% 4 Missing ⚠️
...L.Machine/Corpora/UsfmVersificationAnalyzerBase.cs 78.57% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #432      +/-   ##
==========================================
+ Coverage   73.18%   73.19%   +0.01%     
==========================================
  Files         440      440              
  Lines       36882    36921      +39     
  Branches     5075     5075              
==========================================
+ Hits        26991    27024      +33     
- Misses       8778     8781       +3     
- Partials     1113     1116       +3     

☔ 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.

@Enkidu93 Enkidu93 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Still waiting for a final confirmation from Michael that there's nothing else we'd like to see captured in this analysis.

(Sorry - apparently I never pushed these comments and Reviewable timed out - never had that happen before!)

@Enkidu93 made 5 comments.
Reviewable status: 4 of 10 files reviewed, 4 unresolved discussions (waiting on ddaspit).


src/SIL.Machine/Corpora/UsfmVersificationAnalyzer.cs line 16 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

Can we make this class immutable, or, at least, immutable externally?

Done.


src/SIL.Machine/Corpora/UsfmVersificationAnalyzer.cs line 69 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

I would rename this to UsfmVersificationAnalyzerHandler. I got it confused with the UsfmVersificationAnalyzerBase class.

Done.


src/SIL.Machine/Corpora/UsfmVersificationAnalyzerBase.cs line 25 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

I would rename this to bookIds to differentiate it from the other overloaded method.

Done. I added support for chapter-level filtering as well since we will need this to properly support partial book training.


src/SIL.Machine/Corpora/UsfmVersificationAnalyzerBase.cs line 36 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

I would rename this to bookNums.

Done.

@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.

:lgtm:

@ddaspit partially reviewed 6 files and all commit messages, made 1 comment, and resolved 4 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Enkidu93).

@Enkidu93 Enkidu93 force-pushed the better_usfm_versification_analysis branch from 84d5146 to 222f51c Compare June 25, 2026 14:11
@Enkidu93 Enkidu93 merged commit b56df18 into master Jun 25, 2026
3 of 4 checks passed
@Enkidu93 Enkidu93 deleted the better_usfm_versification_analysis branch June 25, 2026 14:42
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.

Unexpected behavior when changing the versification of a verse range Improvements to UsfmVersificationErrorDetector

3 participants