Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ConvertUsfmVersificationHandler doesn't merge verses correctly

Open
#517 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@Enkidu93 is already working on this.

Since Sep 24, 2026.

Assessment

This issue has not been assessed yet.

Description

The English versification has the following verse mapping for Psalm 51 which merges two verses into one:

PSA 51:0 = PSA 51:1
PSA 51:0 = PSA 51:2
PSA 51:1-19 = PSA 51:3-21

When converting Psalm 51 from Original to English Versification, the following USFM is generated:

\id PSA
\c 51
\s1 Create in Me a Clean Heart, O God
\r (2 Samuel 12:1–12)
\p
\v 0 For the choirmaster. A Psalm of David.
\v 0 When Nathan the prophet came to him after his adultery with Bathsheba.
\b
\q1
\v 1 Have mercy on me,\f + \fr 51:3 \ft Or \fqa Be gracious to me\f* O God,
\q2 according to Your loving devotion;
\q1 according to Your great compassion,
\q2 blot out my transgressions.
...

A test which recreates this scenario:

[Test]
public void GetUsfm_MergedVerses()
{
	// Original vs. English
	// PSA 51:1-3 = PSA 51:0-1

	string usfm =
		@"\id PSA
\c 51
\s1 Create in Me a Clean Heart, O God
\r (2 Samuel 12:1–12)
\p
\v 1 For the choirmaster. A Psalm of David.
\v 2 When Nathan the prophet came to him after his adultery with Bathsheba.
\b
\q1
\v 3 Have mercy on me,\f + \fr 51:3 \ft Or \fqa Be gracious to me\f* O God,
\q2 according to Your loving devotion;
\q1 according to Your great compassion,
\q2 blot out my transgressions.
";

	string target = UpdateUsfm(usfm, sourceVersification: ScrVers.Original, targetVersification: ScrVers.English);
	string result =
		@"\id PSA
\c 51
\s1 Create in Me a Clean Heart, O God
\r (2 Samuel 12:1–12)
\p
\v 0 For the choirmaster. A Psalm of David. When Nathan the prophet came to him after his adultery with Bathsheba.
\b
\q1 \v 1 Have mercy on me,\f + \fr 51:1 \ft Or \fqa Be gracious to me\f* O God,
\q2 according to Your loving devotion;
\q1 according to Your great compassion,
\q2 blot out my transgressions.
";
	AssertUsfmEquals(target, result);
}
Dominant language
C#
Stars
29
Forks
17
Avg merge
2d 5h
Merged PRs (30d)
7

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sillsdev/machine

All issues in sillsdev/machine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.