Skip to content

Commit 55e3b1a

Browse files
pmachapmanEnkidu93
andauthored
Improve versification warnings for invalid chapters and verses (#871)
* Improve versification warnings for invalid chapters and verses * Update to machine version 3.8.0 --------- Co-authored-by: Enkidu93 <lowryec17@gcc.edu>
1 parent 51e46dc commit 55e3b1a

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

src/Machine/src/Serval.Machine.Shared/Serval.Machine.Shared.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
<PackageReference Include="Hangfire.Mongo" Version="1.13.0" />
3939
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="10.0.3" />
4040
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="10.0.3" />
41-
<PackageReference Include="SIL.Machine" Version="3.7.13" Condition="!Exists('..\..\..\..\..\machine\src\SIL.Machine\SIL.Machine.csproj')" />
42-
<PackageReference Include="SIL.Machine.Morphology.HermitCrab" Version="3.7.13" Condition="!Exists('..\..\..\..\..\machine\src\SIL.Machine.Morphology.HermitCrab\SIL.Machine.Morphology.HermitCrab.csproj')" />
43-
<PackageReference Include="SIL.Machine.Translation.Thot" Version="3.7.13" Condition="!Exists('..\..\..\..\..\machine\src\SIL.Machine.Translation.Thot\SIL.Machine.Translation.Thot.csproj')" />
41+
<PackageReference Include="SIL.Machine" Version="3.8.0" Condition="!Exists('..\..\..\..\..\machine\src\SIL.Machine\SIL.Machine.csproj')" />
42+
<PackageReference Include="SIL.Machine.Morphology.HermitCrab" Version="3.8.0" Condition="!Exists('..\..\..\..\..\machine\src\SIL.Machine.Morphology.HermitCrab\SIL.Machine.Morphology.HermitCrab.csproj')" />
43+
<PackageReference Include="SIL.Machine.Translation.Thot" Version="3.8.0" Condition="!Exists('..\..\..\..\..\machine\src\SIL.Machine.Translation.Thot\SIL.Machine.Translation.Thot.csproj')" />
4444
<PackageReference Include="SIL.WritingSystems" Version="17.0.0" />
4545
<PackageReference Include="System.Linq.Async" Version="7.0.0" />
4646
<PackageReference Include="YamlDotNet" Version="16.3.0" />

src/Machine/src/Serval.Machine.Shared/Services/PreprocessBuildJob.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,15 @@ IReadOnlyList<ParallelCorpus> corpora
152152
foreach (UsfmVersificationError error in errors)
153153
{
154154
warnings.Add(
155-
$"USFM versification error in project {error.ProjectName}, expected verse “{error.ExpectedVerseRef}”, actual verse “{error.ActualVerseRef}”, mismatch type {error.Type} (parallel corpus {parallelCorpus.Id}, monolingual corpus {monolingualCorpusId})"
155+
error.Type switch
156+
{
157+
UsfmVersificationErrorType.InvalidChapterNumber =>
158+
$"Invalid chapter number error in project {error.ProjectName} at “{error.ActualVerseRef}” (parallel corpus {parallelCorpus.Id}, monolingual corpus {monolingualCorpusId})",
159+
UsfmVersificationErrorType.InvalidVerseNumber =>
160+
$"Invalid verse number error in project {error.ProjectName} at “{error.ActualVerseRef}” (parallel corpus {parallelCorpus.Id}, monolingual corpus {monolingualCorpusId})",
161+
_ =>
162+
$"USFM versification error in project {error.ProjectName}, expected verse “{error.ExpectedVerseRef}”, actual verse “{error.ActualVerseRef}”, mismatch type {error.Type} (parallel corpus {parallelCorpus.Id}, monolingual corpus {monolingualCorpusId})",
163+
}
156164
);
157165
}
158166
}

src/Serval/src/Serval.Shared/Serval.Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="Grpc.Core.Api" Version="2.76.0" />
2020
<PackageReference Include="Grpc.HealthCheck" Version="2.76.0" />
2121
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.76.0" />
22-
<PackageReference Include="SIL.Machine" Version="3.7.13" Condition="!Exists('..\..\..\..\..\machine\src\SIL.Machine\SIL.Machine.csproj')" />
22+
<PackageReference Include="SIL.Machine" Version="3.8.0" Condition="!Exists('..\..\..\..\..\machine\src\SIL.Machine\SIL.Machine.csproj')" />
2323
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="4.4.0" />
2424
</ItemGroup>
2525

src/ServiceToolkit/src/SIL.ServiceToolkit/SIL.ServiceToolkit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PackageReference Include="Protobuf.System.Text.Json" Version="1.4.1" />
1818
<PackageReference Include="SIL.WritingSystems" Version="17.0.0" />
1919
<PackageReference Include="SIL.Scripture" Version="17.0.0" />
20-
<PackageReference Include="SIL.Machine" Version="3.7.13" Condition="!Exists('..\..\..\..\..\machine\src\SIL.Machine\SIL.Machine.csproj')" />
20+
<PackageReference Include="SIL.Machine" Version="3.8.0" Condition="!Exists('..\..\..\..\..\machine\src\SIL.Machine\SIL.Machine.csproj')" />
2121
</ItemGroup>
2222

2323
<ItemGroup>

0 commit comments

Comments
 (0)