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

Ignore opt break that occurs outside of a segment #243

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Conversation

ddaspit
Copy link
Contributor

@ddaspit ddaspit commented Sep 12, 2024


This change is Reviewable

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.80%. Comparing base (34c3a94) to head (e78d200).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #243   +/-   ##
=======================================
  Coverage   69.80%   69.80%           
=======================================
  Files         379      379           
  Lines       31478    31480    +2     
  Branches     4399     4400    +1     
=======================================
+ Hits        21974    21976    +2     
  Misses       8483     8483           
  Partials     1021     1021           

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

Copy link
Collaborator

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ddaspit)


tests/SIL.Machine.Tests/Corpora/UsfmMemoryTextTests.cs line 193 at r1 (raw file):

            @"\id MAT - Test
\c 1
//

I'm sure you've covered this, but just to check: The project on which this failed had a triple slash ///. Is there any difference in meaning between that and the usual two slashes? I assume your fix will also work for the situation with the triple slash?

Copy link
Contributor Author

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Enkidu93)


tests/SIL.Machine.Tests/Corpora/UsfmMemoryTextTests.cs line 193 at r1 (raw file):

Previously, Enkidu93 (Eli C. Lowry) wrote…

I'm sure you've covered this, but just to check: The project on which this failed had a triple slash ///. Is there any difference in meaning between that and the usual two slashes? I assume your fix will also work for the situation with the triple slash?

The problem wasn't the triple slash, it was the fact that the opt break occurred outside of any segment. In this case, it occurred in-between the chapter marker and the paragraph.

Copy link
Collaborator

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ddaspit)


tests/SIL.Machine.Tests/Corpora/UsfmMemoryTextTests.cs line 193 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

The problem wasn't the triple slash, it was the fact that the opt break occurred outside of any segment. In this case, it occurred in-between the chapter marker and the paragraph.

I get that. I'm asking if the triple slash means the same thing as a normal opt break (I couldn't find anything in the USFM docs and I don't think I've run into it before) and is this fix sufficient to cover cases where markers other than the normal opt break occur outside a segment (if such markers exist). If this triple slash means something other than a normal break, do we need to capture that? And also, if there are any other errors in the same vein as this one, it'd be nice to fix them all at once. Just confirming.

Copy link
Contributor Author

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Enkidu93)


tests/SIL.Machine.Tests/Corpora/UsfmMemoryTextTests.cs line 193 at r1 (raw file):

Previously, Enkidu93 (Eli C. Lowry) wrote…

I get that. I'm asking if the triple slash means the same thing as a normal opt break (I couldn't find anything in the USFM docs and I don't think I've run into it before) and is this fix sufficient to cover cases where markers other than the normal opt break occur outside a segment (if such markers exist). If this triple slash means something other than a normal break, do we need to capture that? And also, if there are any other errors in the same vein as this one, it'd be nice to fix them all at once. Just confirming.

The triple slash isn't part of USFM. Paratext will treat it like an opt break, so we should as well. Opt breaks are basically treated like text. The Text method already has the same check that I added, so it won't have the same issue.

Copy link
Collaborator

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ddaspit)


tests/SIL.Machine.Tests/Corpora/UsfmMemoryTextTests.cs line 193 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

The triple slash isn't part of USFM. Paratext will treat it like an opt break, so we should as well. Opt breaks are basically treated like text. The Text method already has the same check that I added, so it won't have the same issue.

OK, great :lgtm:

Copy link
Contributor Author

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

Dismissed @Enkidu93 from a discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ddaspit)

@ddaspit ddaspit merged commit 2f55e46 into master Sep 12, 2024
4 checks passed
@ddaspit ddaspit deleted the optbreak branch September 12, 2024 23:02
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.

Another USFM-parsing Stack Empty
3 participants