Skip to content

Commit dfcd00f

Browse files
pmachapmanEnkidu93
authored andcommitted
Improve versification warnings for invalid chapters and verses
1 parent 51e46dc commit dfcd00f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

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
}

0 commit comments

Comments
 (0)