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

Fix usfm parsing bugs #447

Merged
merged 16 commits into from
Aug 7, 2024
Merged

Fix usfm parsing bugs #447

merged 16 commits into from
Aug 7, 2024

Conversation

Enkidu93
Copy link
Collaborator

@Enkidu93 Enkidu93 commented Aug 2, 2024

Update Serval to use ParatextProjectTextUpdater


This change is Reviewable

@Enkidu93
Copy link
Collaborator Author

Enkidu93 commented Aug 2, 2024

Parallel PR: sillsdev/machine#229

Copy link
Contributor

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

Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Enkidu93 and @johnml1135)


src/Serval/src/Serval.Shared/Services/IScriptureDataFileService.cs line 6 at r1 (raw file):

{
    ParatextProjectSettings GetParatextProjectSettings(string filename);
    public ZipParatextProjectTextUpdater GetZipParatextProjectTextUpdater(string filename);

The public keyword shouldn't be needed in an interface.


src/Serval/src/Serval.Translation/Services/PretranslationService.cs line 122 at r1 (raw file):

            }
            // In order to support PretranslationUsfmTemplate.Auto
            if (usfm != "")

I think we need to check if the usfm is null.

Copy link
Collaborator Author

@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: 4 of 6 files reviewed, 2 unresolved discussions (waiting on @ddaspit and @johnml1135)


src/Serval/src/Serval.Shared/Services/IScriptureDataFileService.cs line 6 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

The public keyword shouldn't be needed in an interface.

Done.


src/Serval/src/Serval.Translation/Services/PretranslationService.cs line 122 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

I think we need to check if the usfm is null.

Done.

@Enkidu93 Enkidu93 requested a review from ddaspit August 5, 2024 18:22
Copy link
Contributor

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

:lgtm:

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johnml1135)

Copy link
Collaborator Author

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

Sorry, @ddaspit , few more changes: I realized that I was disposing of the ZipContainer prematurely. Also, if a book is totally empty, you do end up with usfm = "" at that check, so a test fails if we just have if(usfm!=null)... - switched to IsNullOrEmpty.

Reviewable status: 1 of 6 files reviewed, all discussions resolved (waiting on @ddaspit and @johnml1135)

Copy link
Contributor

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

Reviewed 5 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Enkidu93 and @johnml1135)


src/Serval/src/Serval.Shared/Services/ZipParatextProjectTextUpdater.cs line 3 at r3 (raw file):

namespace Serval.Shared.Services;

public class ZipParatextProjectTextUpdater : ParatextProjectTextUpdaterBase, IDisposable

You should follow the dispose pattern when implementing IDisposable.

Copy link
Collaborator Author

@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: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @ddaspit and @johnml1135)


src/Serval/src/Serval.Shared/Services/ZipParatextProjectTextUpdater.cs line 3 at r3 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

You should follow the dispose pattern when implementing IDisposable.

Done.

Copy link
Contributor

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

Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johnml1135)

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 93.24324% with 5 lines in your changes missing coverage. Please review.

Project coverage is 61.87%. Comparing base (7e12d7b) to head (95e5111).

Files Patch % Lines
...rval.Translation/Services/PretranslationService.cs 88.63% 0 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #447      +/-   ##
==========================================
+ Coverage   61.84%   61.87%   +0.03%     
==========================================
  Files         234      235       +1     
  Lines       11866    11880      +14     
  Branches     1514     1519       +5     
==========================================
+ Hits         7338     7351      +13     
+ Misses       4003     4002       -1     
- Partials      525      527       +2     

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

@Enkidu93 Enkidu93 merged commit 3520e29 into main Aug 7, 2024
1 of 2 checks passed
@Enkidu93 Enkidu93 deleted the fix_usfm_parsing_bugs branch August 7, 2024 22:32
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.

3 participants