sillsdev / machine

Machine is a natural language processing library for .NET that is focused on providing tools for processing resource-poor languages.
MIT License
26 stars 15 forks source link

Control the pretranslation of existing text #189

Closed johnml1135 closed 6 months ago

johnml1135 commented 6 months ago

https://github.com/sillsdev/serval/issues/370

Reworked the logic of preferring existing or new text.


This change is Reviewable

johnml1135 commented 6 months ago

src/SIL.Machine/Corpora/UsfmTextUpdater.cs line 29 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…
I would make the default `false`, since that is the current behavior.

Done.

johnml1135 commented 6 months ago

src/SIL.Machine/Corpora/UsfmTextUpdater.cs line 363 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…
I wouldn't use `Skip` here. It is not very efficient when operating on a list. It will iterate through the list instead of jumping to the specified index.

OK - reworked algorithm.

johnml1135 commented 6 months ago

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

Previously, ddaspit (Damien Daspit) wrote…
I would rename this test, maybe `GetUsfm_PreferRows`.

done

johnml1135 commented 6 months ago

src/AssemblyInfo.props line 3 at r3 (raw file):

Previously, ddaspit (Damien Daspit) wrote…
Please update the version in a separate PR, especially not in a PR that has already been approved. Update the version to 3.1.1. There isn't enough of a change to warrant a new minor release.

ok

codecov-commenter commented 6 months ago

Codecov Report

Attention: Patch coverage is 96.77419% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 67.12%. Comparing base (7b05b93) to head (a30c2a9).

Files Patch % Lines
src/SIL.Machine/Corpora/UsfmTextUpdater.cs 96.49% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #189 +/- ## ========================================== + Coverage 67.09% 67.12% +0.03% ========================================== Files 441 441 Lines 34855 34890 +35 Branches 4668 4672 +4 ========================================== + Hits 23386 23421 +35 Misses 10376 10376 Partials 1093 1093 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

johnml1135 commented 6 months ago
:lgtm: